Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help needed in sorting expression for bar chart

Hi All ,

i have a trend graph on a bar chart , were i am uploading 3 months of data . i would like to sort data on the basis of last uploaded month data.

for example : i am uploading data for october , november and decemeber . now i need to sort data on the basis of december data and i need to show respective november and october months data .

we have  two dimenions

dottp1p2_enterprisesystem

monthdottp1p2

expression is

sum(days open)/ count(dottp1p2_enterprisesystem)

i use this sort expression

= count({<monthdottp1p2 = {"$(vmonth_current)"}>}dottp1p2_enterprisesystem)


the second image is the right one , for that i also need correspoding novemeber and october values .

i am getting the first image which is a wrong one .

hope it helps

16 Replies
arsal_90
Creator III
Creator III

can you share you qvw file. It's easy to work on your file and resolve your problem

Not applicable
Author

i am sorry , i cannot send the qlikview file .i would like to know , how to sort a expression in descending order by using a sort expression . i hope you dont get confused by sort a expression and sort expression

beck_bakytbek
Master
Master

Hi Aditya,

Try this: go to tab Sort: and use: Numeric Value: Ascending or Descending

Hope this helps

Beck

balkumarchandel
Specialist II
Specialist II

Hi Find attached solution and check the sort expression and its properties. In the place of hard coded value you can use your variable.

Hope this help.

balkumarchandel
Specialist II
Specialist II

Let me know if you are looking for something else.

Not applicable
Author

Hi Balkumarchandel,

can you please , copy paste the logic . since i am using dekstop version . or else image of sort tab

balkumarchandel
Specialist II
Specialist II

You need to use your sort expression in both the dimension and uncheck everything else.

Find below code your can first try to implement this example in separate document.

Load script :

load * inline [

Dim,Month,value

A,10,1

A,10,2

A,11,1

A,11,2

A,11,3

A,12,2

A,12,1

B,10,1

B,10,2

B,11,1

B,11,2

B,11,3

B,12,2

B,12,1

B,12,3

B,12,4

C,10,1

C,10,3

C,10,4

C,10,2

C,11,1

C,11,2

C,11,3

C,12,2

C,12,1

C,12,3

];

Not applicable
Author

but my expression here is = sum(days open)/ count(dottp1p2_enterprisesystem), which is not count .so how do i use sort expression ?

balkumarchandel
Specialist II
Specialist II

count is not necessary .. Just use your expression in place of mine and check or uncheck the option as given in solution.

It will work.