Hey,
How can i retrieve in a collection, the last in date of each store.
DATAVERSE TABLE:
StoreName | Created On | Name | Store Number |
Store1 | 01/02/2022 | S_86 | 5658 |
Store1 | 04/02/2022 | S_87 | 5655 |
Store2 | 02/01/2022 | S_65 | 2523 |
Store2 | 03/10/2023 | S_64 | 6565 |
So that in my collection i have the S_87 of store1 and S_64 of store2 only.
Thanks.
Hi @LoopinG2023 ,
My fist try includes using GroupBy to get the unique values for StroreName and AddColumns to get the name value of the most recent item per StoreName:
ClearCollect(
CollectionName,
AddColumns(
GroupBy(
DATAVERSE TABLE,
"StoreName",
"ItemsByStoreName"
),
"LastCreatedName",
First(
Sort(
ItemsByStoreName,
'Created On',
SortOrder.Descending
)
).Name
).LastCreated
)
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2