Vizlib Filter - Manual Sorting?
Good day everyone!
With some 'If' and 'Mixmatch' magic, I have managed to create a fixed list of filters, looking like this:
Despite the 6 sorting methods available, I can't seem to get the sorting right. I'd like to use this order (top to bottom): Hard,Soft,Virtual,Avoidance,N/A. I hoped it was going to be as simple as stating 'Hard','Soft','Virtual','Avoidance','N/A' in the 'Sort by Expression' feature but that doesn't work. Ideas?
This is really more of a Qlik question than a Vizlib question... you'd have the same problem with a native filter, and presumably use the same solutions.
Some ways to go about it, assuming you don't want to modify the actual values e.g. by using 1-Hard, 2-Soft etc.
1) Use Dual() to assign each value with a number and sort by numeric.
2) Script-load these values each with a second field holding the sort order (I'm calling that numeric field SortOrder), and then sort by expression - SortOrder.
3) Load this list earlier in the script as an inline, in the order you want it to be displayed in, and then uncheck all the boxes to sort by load order.
1 person likes this
Thank you Or Shoham! The Dual function indeed did the trick. Looks much better :)
Topics in this forum
Didn't find what you were looking for?
Start a new topic