Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
rvijayanth
Contributor

Need help with sorting using expression

I have ONE chart with variable dimension and corresponding counts. Based on a variable this chart will show counts for (Sex) or (Insurance)

If variable 1 is selected, the chart will be as follows: Note: (Sorting is based on ascending order of Sex column)

Sex            Count

Female      12

Male          24

Unknown   2

Total          38

If variable 2 is selected, the chart will be as follows: Note: (Sorting is based on Descending order of Count)

Insurance          Count

Insurance 2       20

Insurance 1       11

Insurance 3       7

Total                 38


Please help me accomplish this using expression

4 Replies
Khan_Mohammed
Honored Contributor II

Re: Need help with sorting using expression

Use these 2 expressions for each dimensions in Sorting Tab (sort by expression)

For S**: aggr(Yourexpression, S**)

For Insurance: aggr(Yourexpression, Insurance)

And then adjust the expression sorting to Ascending or Descending as per your view.

Re: Need help with sorting using expression

Dimension itself is changing based on selection of a variable?

rvijayanth
Contributor

Re: Need help with sorting using expression

Yes

Re: Need help with sorting using expression

Would you be able to share a sample where you are trying this?