Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for 
Search instead for 
Did you mean: 
PrashantRupani
Creator
Creator

Straight table sort (Sorting condition is different)

Hi,

I have a straight table in Qlik Sense. I have a column which picks the dimension based on pick match function. Then the next column is a Sales measure

When the dimension is Calendar Week , then sort the table descending by most recent week. 

Calendar Week     Sales

2/28/2021               500

2/21/2021               200

2/14/2021               300

2/7/2021                 400

When the dimension is Region , sort the table descending by Sales. 

Region                   Sales

USA                       500

Canada                300

UK                          200

How do I achieve this?

Labels (1)
1 Solution

Accepted Solutions
Or
Master
Master

Since you can't dynamically change the sort order field list as far as I know, you'd have to try and use something like sort by expression, with the expression being:

If(myPickValue='Week',Week,Aggr(Sum(Sales),Region))

Not sure if this will work, but something in that direction should be the approach, I think.

View solution in original post

2 Replies
Or
Master
Master

Since you can't dynamically change the sort order field list as far as I know, you'd have to try and use something like sort by expression, with the expression being:

If(myPickValue='Week',Week,Aggr(Sum(Sales),Region))

Not sure if this will work, but something in that direction should be the approach, I think.

View solution in original post

PrashantRupani
Creator
Creator
Author

Thanks. 

Something along this line as you mentioned worked for me. 

 

Thanks again.