Changing Sort based on condition

Changing Sort based on condition


I have a list of events and a switch to show either past or future events.  I want to show future events earliest first but past events i want to show latest first.

Is there a way to change the sort from ASC to DESC on the datetime field based on this variable?  In the past I have had 2 have 2 separate aggregates and 2 separate tables.

Thanks for any help


Hi Daniel.

To have the sort based on a variable and want to use an aggregate you can always use a Dynamic Sort parameter:

The other option is having an advanced query and there you can also control the order by, by adding an input with the values you need for the clause, and not forgetting to put the parameter as expand inline.

Hope this helps.