Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting


Hi,

I have a calculated dimension whoch contains Month and Year fields concatenated together. Month field has values starting from Jan to Dec whereas Year field has values from 2013 onwards. My calculated dimension has values Jan 2013 and so on.

How do i sort theses values on the x axis of the chart so that i get values arranged properly e.g starting from Jan 2013 to Dec 2014.

Thanks

4 Replies
Anonymous
Not applicable
Author

Hi Asma,e

You can concatenate month with year in the script like as " month & year" as MonthYear

then you can pass this in dimention in chart in sort tab select the MonthYear and check  enable  'load order' then you can get the monthyear field in the order.

Hope this would be helpful for u.

Thanks

Not applicable
Author

Write sort expression based on table fields.

ashfaq_haseeb
Champion III
Champion III

Hi,

use this in your script

MonthName(yourdatefield) as Monthyear,

It will give you month and year together the way you are looking at, and it will be sorted.

Regards

ASHFAQ

MK_QSL
MVP
MVP

Considering that the Date field which you are using for your Calculated Dimension is named as Invoice Date....use below formula to create MMM YYYY ...

Calculated Dimension

=DUAL(Date(MonthStart([Invoice Date]),'MMM YYYY'),Date(MonthStart([Invoice Date]),'YYYYMM'))

Expression

SUM(Sales)

or whatever as per your datamodel...

Using this, you can now sort the MonthYear field as Numeric field...