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: 
niha
Creator II
Creator II

Date Format issues

Hello,

I have the following script. And it is working well.

 

Date(Date#([Date of First Service],'YYYY/MM/DD')) as [Date of First Service],
Year(Date(Date#([Date of First Service],'YYYY/MM/DD'))) as DFSYear,
Month(Date(Date#([Date of First Service],'YYYY/MM/DD'))) as DFSMonth,
Year(Date(Date#([Date of First Service],'YYYY/MM/DD'))) & Month(Date(Date#([Date of First Service],'YYYY/MM/DD'))) as DFSYearmonth,
Day(Date(Date#([Date of First Service],'YYYY/MM/DD'))) as DFSDay,

In the screen shot, the Year Month Format is 2016Dec, 2016Aug like this  But I want (201601,201602,201603.......) and in chronological order.

Secondly I also want to load Monthabbr () like 1 for Jan , 2 for Feb so on 

Please suggest.

Regards,

niha

Untitled.png

2 Solutions

Accepted Solutions
albertovarela
Partner - Specialist
Partner - Specialist

you can enclose the Month with num:


Year(Date(Date#([Date of First Service],'YYYY/MM/DD'))) & num(Month(Date(Date#([Date of First Service],'YYYY/MM/DD')))) as DFSYearmonth,
num(Month(Date(Date#([Date of First Service],'YYYY/MM/DD')))) as Monthabbr 

View solution in original post

niha
Creator II
Creator II
Author

Thanks. It worked.Smiley Happy

View solution in original post

2 Replies
albertovarela
Partner - Specialist
Partner - Specialist

you can enclose the Month with num:


Year(Date(Date#([Date of First Service],'YYYY/MM/DD'))) & num(Month(Date(Date#([Date of First Service],'YYYY/MM/DD')))) as DFSYearmonth,
num(Month(Date(Date#([Date of First Service],'YYYY/MM/DD')))) as Monthabbr 

niha
Creator II
Creator II
Author

Thanks. It worked.Smiley Happy