Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date format

Hi All

I have dimension as below

=Month(CalDate) & ' ' & chr(39) & Right(Year(CalDate), 2) which gives me dimension as Jan '16, Feb '16 and so on (and this is fine)

I also have columns CallMonth as 1,2,3...12 and CallYear as 2016 & 2017 in my Data model

With this I' m unable to sort date

I have also tried to sort with below two

1. CallYear & CallMonth

2. Num(CallYear & CallMonth) both

Still the issue to sort

Thanks in advance

8 Replies
sunny_talwar

May be try this as your dimension

Dual(Month(CalDate) & ' ' & chr(39) & Right(Year(CalDate), 2), MonthName(CalDate))

antoniotiman
Master III
Master III

I suggest You to calculate Dimension like this

Date(CalDate,'MMM ''YY')

This is Dual Field

sunny_talwar

I would suggest adding MonthStart here

Date(MonthStart(CalDate), 'MMM ''YY')

Colin-Albert

or you could use monthname()

MonthStart will ensure that the numeric part of the date value is the 1st of the month and you are not getting a repeated value for each date. Monthname will show the date as MMM YYYY and will sort correctly

MonthName(MonthStart(CalDate))

Anonymous
Not applicable
Author

Hi Antonio

With this it hide some columns, I believe data model issue.

I appreciate your time and efforts.

Thanks

sunny_talwar

I think if formatting is not needed, you can just do

MonthName(CalDate)

MonthName will essentially do the same thing as MonthStart...

Anonymous
Not applicable
Author

Hi Sunny

It works, thanks for suggestion@

sunny_talwar

I am glad it helped