Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a simple bar chart with a hierarchical dimension. I wish to sort the X-Axis based on the level of the dimension. My hierarchy is like SBU > BU > Sub BU. At each level of drill down I expect it to be sorted on an independent sort field that is already defined. One possible way is to have a combined sort order in a single field and as you drill down it should continue with the expected sort order.
Let me know if my question is clear, else I will attempt to explain further.
Advance thanks.
You can use the GetCurrentField function to check which field in the drilldown group is active. You can use that in an expression to determine the sorting:
If(GetCurrentField([MyDrillDonGroup])='SBU', ...sort_expression_for_sbu... ,
If(GetCurrentField([MyDrillDownGroup])='BU', ...sort_expression_for_bu... , ...sort_expression_for_SubBU... ))
Thanks. Sounds logical. However, for some reason I am unable to pick the Group dimension that is named as OrgHierarchy. I tried this syntax but it did not work.
=If(GetCurrentField('OrgHierarchy')='SbuAbbr', SbuSortOrder ,
If(GetCurrentField('OrgHierarchy')='BuAbbr', BuSortOrder ,
If(GetCurrentField('OrgHierarchy')='SubBuAbbr', SubBuSortOrder )))
Typing [OrgHierarchy] did not work too.
Am I missing some point?
That should work. Try using the GetCurrentField function in a textbox and see what it returns. Or post a qlikview document that demonstrates the problem so we can have a look at what's going on.
I will certainly try this today and revert.
In the meantime, I was able to research another alternative. One can define sort orders for each of the hierarchical dimensions similar to any other charts. Click Edit Groups, Select the drill down dimension and click edit. Next click sort orders in the bottom of dialog box. Select each level and define your sort preferences.
This works and is pretty elegant.