Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Sort by Y-Axis programmatically

Hi -

I am building a stacked bar-chart with a user toggle between sort-alphabetically and sort-by-total descending.  The problem is when the Y-axis has multiple elements then this sort statement ...

=if(vSortByCaption='Name',vXAxis_col,-1 * $(=vFormula))

... results in a sort by the largest single Y element, not the Y total.; but if I turn on "Sort by Y-Axis" then I lose the ability to sort alphabetically.  See attached screenshot below.

Is there a better way to code the sort expression or else to programatically toggle the "Sort by Y-Axis" checkbox?

Thank you


Tags (3)
1 Reply

Re: Sort by Y-Axis programmatically

if I understand your question you can try to sort by

aggr(sum(Value), MonthData)

where Value is expression and MonthData is your first dimension

see attachment