Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

satishkamath
Contributor II

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
MVP
MVP

Re: Date format

May be try this as your dimension

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

antoniotiman
Honored Contributor III

Re: Date format

I suggest You to calculate Dimension like this

Date(CalDate,'MMM ''YY')

This is Dual Field

MVP
MVP

Re: Date format

I would suggest adding MonthStart here

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

Re: Date format

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))

satishkamath
Contributor II

Re: Date format

Hi Antonio

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

I appreciate your time and efforts.

Thanks

MVP
MVP

Re: Date format

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

MonthName(CalDate)

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

satishkamath
Contributor II

Re: Date format

Hi Sunny

It works, thanks for suggestion@

MVP
MVP

Re: Date format

I am glad it helped