I have the below formulas in the App onstart property so that it creates these collections filters them and sorts them by month. Then I Concatenate all sorted month collections into a final collection (ShuffledNames) for display in my gallery. The issue is in the sort part where I keep getting the function sort has some invalid arguments. Any help will be mych appreciated
ClearCollect(
FilteredRecords,
Filter(
'ES year to year dash',
'Date of mention' >= DateAdd(Today(), -8, TimeUnit.Months)
)
);
ClearCollect(
Month1Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(Today()) && Year('Date of mention') = Year(Today())
)
);
ClearCollect(
Month2Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -1, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -1, TimeUnit.Months))
)
);
ClearCollect(
Month3Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -2, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -2, TimeUnit.Months))
)
);
ClearCollect(
Month4Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -3, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -3, TimeUnit.Months))
)
);
ClearCollect(
Month5Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -4, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -4, TimeUnit.Months))
)
);
ClearCollect(
Month6Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -5, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -5, TimeUnit.Months))
)
);
ClearCollect(
Month7Records,
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -6, TimeUnit.Months)) && Year('Date of mention') = Year(DateAdd(Today(), -6, TimeUnit.Months))
)
);
// Repeat for each month within the last 8 months...
// ClearCollect to create sorted collections for each month
ClearCollect(
SortedMonth1,
Sort(
Filter(
FilteredRecords,
Month('Date of mention') = Month(Today()) && Year('Date of mention') = Year(Today())
),
Descending,
'Date of mention'
)
);
ClearCollect(
SortedMonth2,
Sort(
Filter(
FilteredRecords,
Month('Date of mention') = Month(DateAdd(Today(), -1, Months)) && Year('Date of mention') = Year(DateAdd(Today(), -1, Months))
),
Descending,
'Date of mention'
)
);
ClearCollect(
ShuffledNames,
Concat(
SortedMonth1,
SortedMonth2,
// Include other sorted month collections here...
)
)

Report
All responses (
Answers (