Sorting by 2 or more tags, with different order (flux)

I want to sort some of my tags by ascending order, and some of them with descending order.
for example tag1 and tag 2 by ascending order,
and tag 3 by descending.
there is way to do that with Flux?

I think to do something like this:
|> sort(columns: [“tag1”, “tag2”], desc: false)
|> sort(columns: [“tag3”], desc: true)

but it’s not working for me…
any idea, thanks.

Hello @Amos_Guetta,
If you apply two sorts after each other, the data will be transformed in that order.
I think you’ll have to perform two queries for each sort and then join them.

A better question might be, what are you trying to accomplish? What’s the bigger picture? There might be an elegant solution with some more context. Thank you.

Thanks for the answer,
we have InfluxDB with data that collect from switches, the data is statistic network traffic and we build some visual tables and graphs so we need the option to sort the tags.
but we want the ability to sort group of tag by ascending order and other by descending…
the join query will be not efficient, so its not good solution.