Hi everyone, I love this ORDERBY() expression, and it’s already extremely useful, however I wanted to enhance its usefulness even more by adding another column condition to the end (like Excels top-down approach to columnsort). Is this possible to achieve by changing my expression ever so slightly?
My current expression (being used in an attachment template) is as follows…
<<Start: ORDERBY(FILTER(“Timesheet”, AND( [Status] = “COMPLETE”, [Date] >= [From], [Date] <= [To])), [Machine])>>
What I would like to do is sort by [Machine], as well as another column (e.g Type / Date / Name etc).
Hopefully this is doable, and if so doesn’t require a lot of tweaking.
Thanks for reading guys.
Solved! Go to Solution.
That’s correct @Dario. The expression I have given is just an example so that you can fit it into yourself as I’m unaware of your table schema.
ORDERBY(
FILTER(
"Timesheet", // Filtered tablename
AND(
[Status] = "COMPLETE",
[Date] >= [From], [Date] <= [To]
) // Filter condition
),
[Machine], // Ordering column
TRUE, // TRUE: Ascending | FALSE: Descending
[Date], // Ordering column
([Date]<=TODAY()+10,[Date]>=TODAY()+10), // TRUE/FALSE statement
[Type], // Ordering column
(CONTAINS[Type],"Some Type") // TRUE/FALSE statement
)
User | Count |
---|---|
43 | |
26 | |
23 | |
14 | |
13 |