Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Raggs
Contributor III
Contributor III

Date derive as YYYYMM from the date field

I have a date as below 

From date
01-01-2019
01-09-2019

 

I need the date field as below given

From date
201901
201902
201903
201904
201905
201906
201907
201908
201909
201910
201911
201912

 

Can any one help me on this on urgent basis...

Thanks in advance 

8 Replies
Vegar
MVP
MVP

Try this:

LOAD 
Date(date#([From Date], 'DD-MM-YYYY'), 'YYYYMM') as [From Date]
FROM ...

Raggs
Contributor III
Contributor III
Author

Hey Vegar, Thnaks for your reply, 

However its not working.. we are getting null values... 

 

Raggs
Contributor III
Contributor III
Author

I have used below

Text(left(Date(MD_FromDate,'YYYYMMDD'),'6')) as MD_FDate_YYYYMM,

 

 

for this I am getting as below 

Raggs_0-1599120241519.png

 

but, I need the values with iteration of all months like below listed.

From date
201901
201902
201903
201904
201905
201906
201907
201908
201909
201910
201911
201912
Taoufiq_Zarra

@Raggs 

what is the link between input and output?

how do you get 201901 -> 201912 from both dates :

01-01-2019
01-09-2019
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Kushal_Chawda

@Raggs  try below

Date(floor(MD_FromDate),'YYYYMM') as MD_FDate_YYYYMM

Raggs
Contributor III
Contributor III
Author

Hello Taoufiq, 

there is no link, we have the date values like this and need to get the entire months for year.

Raggs
Contributor III
Contributor III
Author

This is working and getting the values as below only 

201901

201909

 but, we need it to entire year

Brett_Bleess
Former Employee
Former Employee

Some Design Blog posts that may be helpful:

https://community.qlik.com/t5/Qlik-Design-Blog/Why-don-t-my-dates-work/ba-p/1465849

https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.