Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

zagzebski
Contributor

Advanced Sorting (by field not in dimension or epxression)

I have a field that I want to sort by but I don't want it in my chart.

My chart: Dimension is Month and expressions are previous 12 months, previous 13-24 months etc. So currently I have data through August so  each expression will just have the total of  September - August (the last 12 months and so on). I know I could us the match function in the expression area of sort but that would have to be changed every month then and need to be dynamic in case the selection was different. What I really want to do is sort by my MonthYear field 201309, 201310, etc. but not have it anywhere in the chart because it is doesn't allow for expressions to be on the same line since the year is included.

Any thoughts?

1 Solution

Accepted Solutions
adamdavi3s
Honored Contributor

Re: Advanced Sorting (by field not in dimension or epxression)

This will not work if you have dates selected in the dashboard.


This is why you need the "only" formula as the {1} set analysis tells it to disregard any selections in the sort.

18 Replies

Re: Advanced Sorting (by field not in dimension or epxression)

You could convert your static match-expression into a dynamically expression with $-sign expansion:

match(Month, $(=Expression))

whereat expression returned your numeric/string-list of month/time-periods per loop/concat from min/max time-period or getfieldselections.

- Marcus

Re: Advanced Sorting (by field not in dimension or epxression)

In the chart's sorting tab you can define a sorting expression, i.e. You could display your month dimension but sort by your MonthYear field.

regards

Marco

zagzebski
Contributor

Re: Advanced Sorting (by field not in dimension or epxression)

So I am not sure what would go in your expression above.

My dimension is:

Month: Jan, Feb, March, etc.

I want to sort by but not have in my dimension:

MonthYear: 201308, 201309, 201310, etc.

This way Aug would be first, then Sept, then Oct and so on

Just not sure how that works into your example from above

zagzebski
Contributor

Re: Advanced Sorting (by field not in dimension or epxression)

But how would I sort by MonthYear in my sorting expression? Not sure of the syntax.

Thanks.

ecolomer
Honored Contributor II

Re: Advanced Sorting (by field not in dimension or epxression)

Put in the expresion to order

p5.png

Re: Advanced Sorting (by field not in dimension or epxression)

You aren't limited by fields in your chart - you could use all fields which are assigned together - for example if they are from the same table or connected by a key to a master-calendar or similar.

In your case will be properly an avg(MonthYear) in the sort-expression work.

- Marcus

adamdavi3s
Honored Contributor

Re: Advanced Sorting (by field not in dimension or epxression)

I tend to use =only({1}MonthYear)

This means month selections don't cause things to re-order etc

zagzebski
Contributor

Re: Advanced Sorting (by field not in dimension or epxression)


I put "MonthYear" in the sort expression but still not working. This is the data:

untitled.png

zagzebski
Contributor

Re: Advanced Sorting (by field not in dimension or epxression)

I tried putting that in but still not working. I included what I want to get to work in a reply above.

Community Browser