Hi all,
Flow: forms are filled by different users (data to Sharepoint), the forms are to-be evaluated. Each form 'is valid' for a period of time (specified by the user), for each time-unit in the period a record is created in the Sharepoint.
E.g. now = 28-11-2022 11:59:00.000
ID | USER | ENTRYDATE | DATEVALID | FORMDATA
1 | x | now | 01-01-2022 | 123
2 | x | now | 01-02-2022 | 123
3 | x | now | 01-03-2022 | 123
4 | y | now | 01-01-2022 | 321
5 | y | 01-01-2022 | 01-01-2022 | 434
in this example USER `x' filled the form for the first 3 months of 2022;
`y' filled the form twice for the same period (Januari 2022) on different dates.
I would like an overview of the forms in a table, more specifically, I want a table where I can see the most recent record per person that are valid in a specific period, thus, i.e. in the case that I choose Januari 2022, I want to see IDs 1 and 4; in the case that I choose period Januari to March 2022, I want to see IDs 3 and 4.
I was thinking of using a GroupBy for the USER, and First(Sort())... in order to get the most recent records *.
* Note that I already have some code to sample the records that are valid within some chosen period. Hence, I want the record with the most recent ENTRYDATE per USER.
AddColumns(
GroupBy(
//Piece of code to sample records within a chosen period
Filter(
'Vendor Rating',
DatePickerStart.SelectedDate <= MonthYear &&
DatePickerEnd.SelectedDate >= MonthYear &&
Title = ComboBox2.Selected.Title
),
"USER",
"data"
),
"blabla",
First(
Sort(
GroupBy(
Filter(
'Vendor Rating',
DatePickerStart.SelectedDate <= MonthYear &&
DatePickerEnd.SelectedDate >= MonthYear &&
Title = ComboBox2.Selected.Title
),
"USER",
"data"
),
"ENTRYDATE",
Descending
)
)."ENTRYDATE"
)
This is my code so far.. Not working.
Any help would be much appreciated!
KR,
Rix
(@WarrenBelz, do you perhaps have a clue how to tackle this one?)

Report
All responses (
Answers (