Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have created a bar chart, and I want to sort the bars in a specific order.
I want to sort by "Region" - "Office", like this:
RegionA - Atalanta
RegionA - Colorado
RegionB - Boston
... without showing the Region in the labels.
Is it possible to sort by any expression that includes the region's alphabetical order? Right now I can only sort at the office alphabetical order: Atalanta, Boston, Colorado...
Thanks in advance
Filip
HI
Try like this
Sort tab->expression
=SubField(FieldName,'-',2)
Unfortunately it doesn't work as the SubField function slices the array first, and sorts after that... Still the same result.
Is it possible to do this in another way?
Filip,
Try to eliminate only 'Region' in sort expression:
repalce(FieldName, 'Region', '')
Regards,
Michael
Or, is it that Region and City are two separate fields, and you want to use City as label but sort by Region/City combination? If yes, try to sort by expression
=Region & City
Reagas,
Michael
Yes, exactly as you writes...
But still, the diagram doesn't load the bars in this order...
Indeed, it doesn't work...
You best bet is to create an additional field Order in the script:
LEFT JOIN (table) LOAD Distinct
Region,
City,
Rowno() as Order
Resident table
ORDER BY Region, City;
And, use it in sort expression:
=Order
Regards,
Michael
Yeah, I also found a solution with an inline table:
http://www.qlikfix.com/2010/10/25/creating-a-custom-sort-order/
But still, I don't think this is a very good solution. Why do I have to create a field, just to make my dimension sort from any other field...
Thank you very much for your help though! Really appreciated!
Best regards,
Filip