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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sort Calculated Dimension.

Hi,

I have a calculated dimension: month(book_gl_date)&'-'& year(book_gl_date)

Here book_gl_date is a date type column. The result of above calulated dimension is a string in format like Nov-2014, Oct-2014...so on.

How to sort that in 'Sort' tab. By default it sorts by treating it as a text. Hence Apr-2014 comes before Jan-2014. I want to sort it as per calendar for example: Jan-2014, Feb-2014, Mar-2014...

Please find the attached screenshot.

3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Better create this field in Script by using Date Functions

or change your calculated dimension to

Date(MonthStart(book_gl_date), 'MMM-YYYY')

and sort order as numberic

anbu1984
Master III
Master III

Use this expression in sort tab

=date(book_gl_date,'YYYYMM')

ashfaq_haseeb
Champion III
Champion III

Hi,

Try this in script

MonthName(book_gl_date) as MonthYear


Now use this field as dimension.

Let me know if that worked.


Regards

ASHFAQ