Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
arpitkharkia
Creator III
Creator III

Date format issue

Hi all,

PFA the qlikview app. I want the dimension YearMonth as Jan-2017, Feb-2017 from 12017, 22017 and so on.

Thanks for your help!

1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Try with :

Load *,
if(len(YearMonth)=5, date(date#(YearMonth,'MYYYY'),'MMM-YYYY'), date(date#(YearMonth,'MMYYYY'),'MMM-YYYY')) as newfield
Resident Table;

View solution in original post

15 Replies
tresesco
MVP
MVP

Try:

=Date(Date#(YearMonth,'MYYYY'),'MMM-YYYY')

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

Load field, date(date#(field,'MYYYY'),'MMM-YYYY') as newfield

From xyz

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
prma7799
Master III
Master III

Try this

Table:

LOAD * INLINE [

    YearMonth

    12017

    22017

    32017

    42017

    52017

    62017

    72017

    82017

    92017

    102017

    112017

    122017

];

Load *,

Year(Date#(YearMonth,'[]YYYY')) as Year,

Date(Date#(YearMonth,'MYYYY'),'MMM-YYYY') as NewYearMonth

Resident Table;

arpitkharkia
Creator III
Creator III
Author

I followed the same approach. The issue is highlighted below

arpitkharkia
Creator III
Creator III
Author

For cases 112017 and 122017 im getting Jan-12017 and Jan -22017. How to resolve this?

tresesco
MVP
MVP

Sorry, one 'M' was missed. Try:

Date(Date#(YearMonth,'MMYYYY'),'MMM-YYYY')

arpitkharkia
Creator III
Creator III
Author

This working for those where Month is 2 digits. Not for rest of the cases.

prma7799
Master III
Master III

Try this

Table:

LOAD * INLINE [

    YearMonth

    012017

    022017

    032017

    042017

    052017

    062017

    072017

    082017

    092017

    102017

    112017

    122017

];

Load *,

Year(Date#(YearMonth,'[]YYYY')) as Year,

Date(Date#(YearMonth,'MMYYYY'),'MMM-YYYY') as NewYearMonth

Resident Table;

sannidhikumar
Creator
Creator

Try this Arpita.

Date(Date#(YearMonth,'MMMYYYY'),'MMM-YYYY') AS YearMonth