cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lexicron
Resolver II
Resolver II

Filter for latest Date per Site per Person

I am crossposting this from the Power Apps Community/CDS forum. I couldn't find a Flows section there.

 

I have a CDS entity with records like the following:

Clipboarder.2020.05.26.png

 
 

The same person can login at different Sites. I need to pick out the latest login date per site, per person. I need a filter function like Max(Date) but I don't think that exists. For example: Yasmeen Galloway logged in at Bristol two times, but since 2 May is more recent than 1 May, the first record is discarded and the second is needed. She also logged in at Irving, so I also need her most recent login date there. The same goes for Essa Swift. These are the yellow highlighted records.

 

How do I set up a Flow (to be scheduled every week) to pull out the yellow records I need and email them in an Excel table (or even within the email) to myself/someone?

 

I am thinking of adding another field "UniqueSearch" to my entity that concatenates Full Name and Site, this would reduce the search for duplicates to just 1 column (UniqueSearch) instead of 2 (Full Name and Site). So I just need Max(Date) per UniqueSearch. But I still don't know how to achieve Max(Date).

 

I have found similar posts with solutions but they are all in PowerApps Canvas. I am not working in Canvas for this.

 

I found the $apply query option on StackOverflow which seems to fit. To suit my case I would probably rewrite it to

$apply=groupby((UniqueSearch),topcount(1,Date desc))

but I can't finagle it to work in Flow because Flow wants an aggregation.

 

Any help is appreciated. Please and thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Lexicron ,

 

Sorry for I'm afraid that the requirement couldn't be achieve in Microsoft flow currently.

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-alzhan-msft
Community Support
Community Support

Hi @Lexicron ,

 

Sorry for I'm afraid that the requirement couldn't be achieve in Microsoft flow currently.

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-alzhan-msft/Alice!

Helpful resources

Top Solution Authors
Users online (3,733)