I am using the following code to get the newest distinct value based on Unique GRS
ForAll(
GroupBy(
LogDataALL,
"GRS",
"_items"
),
First(
Sort(
_items,
'Log Date',
SortOrder.Descending
)
)
)
What i need to add is another Sort function that will show the oldest record 1st based on the unique values.
Any ideas welcome please
Thanks for the suggestion, this seems to have now lost the Unique validation from the GRS field and now hides many of the fields that are powered by the drop down.
I use this in my visible field
HubSelection_1.Selected.Value in ThisItem.ManagerLevel
Hi @Markswan20 ,
Do you want newest and oldest at the same time?
Please try this:
Ungroup(ForAll(
Distinct(
LogDataALL,
GRS
) As C,
Table(Last(
Sort(Filter(
LogDataALL,GRS=C.Value),
'Log Date',
SortOrder.Descending
)
),
First(
Sort(Filter(
LogDataALL,GRS=C.Value),
'Log Date',
SortOrder.Descending
)))
),"Value")
That's ok, by replacing First to Last it give me the oldest unique value instead of the newest.
Sorry, I didn't notice that.
I have just modified my formula, or you can replace First with Last in your formula.
Thanks for the response Rimmon, this gives the same results as my code.
Hi @Markswan20 ,
Please try this:
ForAll(
Distinct(
LogDataALL,
GRS
) As C,
Last(
Sort(Filter(
LogDataALL,GRS=C.Value),
'Log Date',
SortOrder.Descending
)
)
)
Best regards,
Rimmon
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.