Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use a Button to change the sorting of a table (no pivot-table).
Let's assume that I have 2 columns in the table: Col1 and Col2. If the Button is clicked, I want to change the value of a local variable 'vTableSort' from 'Col1' to 'Col2' and vice-versa. If 'vTableSort' has the value 'Col1', the table should be sorted ascending based on 'Col1'. If 'vTableSort' has the value 'Col2', the table should be sorted descending based on 'Col2'.
I would appreciate if anyone could help me out with this!
You'll need to drag up this column so it's the first in the sort tab, uncheck sort auto and check 'sort by expression' can use this expression:
If( variable='col1', 'col2', 'col1')
not sure for button but in pivot report you can do the same.
Vikas
Can u try like
If( variable='col1', 'col2', 'col1')
Where am I supposed to write that? There is no "Sort by Expression" field for a table.
In expression of Sort tab, use below
If( variable='col1', 'col2', 'col1')
another approach :
https://community.qlik.com/t5/New-to-Qlik-Sense/Custom-Sort/td-p/1666109
another approach :
https://community.qlik.com/t5/New-to-Qlik-Sense/Custom-sorting-of-Dimentions/td-p/1285062
https://community.qlik.com/t5/App-Development/Sort-by-expression-filter-box/m-p/1866419#M71527
hope this will help
Vikas
Hey, thank you for your reply! I think that this is exactly what I want. However, I can't find an expression field in the sorting tab. Attached you find a screenshot of how it looks like for me. Maybe I misunderstood, where I have to make these changes.
You'll need to drag up this column so it's the first in the sort tab, uncheck sort auto and check 'sort by expression' can use this expression:
If( variable='col1', 'col2', 'col1')
not sure for button but in pivot report you can do the same.
Vikas