Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Type

Hey Community,

I have Field date whit the following Build

Date
May 1, 2015
January1,2015
June 8, 2015
July 1, 2015
June 8, 2015
June 8, 2015
July 1, 2015
June 8, 2015
June 8, 2015
June 8, 2015

My question is how can i get the Year Month And Day at separate, I try to use Year month and day function but it dint work for me  e.c

Year:2015....

Month:June,July....

Thx

Hey guys, I said i try to use the function Year(), Day(),Month() But it didnt work. i add the app and screen shot hope you will help me Thank you guys

13 Replies
Chanty4u
MVP
MVP

Thnks But I dont drink

jonathandienst
Partner - Champion III
Partner - Champion III

david Ben Shimol wrote:

its work but still you can find at the app that two dates are in different type,

if you load the original data you will find that there is 2 dates that have only year and whit your solution it dont bring them back.

Its a pity you did not include that information in your post, but its not that difficult to handle. Just use Alt() to select the first date conversion that works - assuming taht the alternative is a year like "2016", then:

     Date(Alt(Date#(Date, 'MMMM dd, yyyy'), Date#(Date, 'yyyy'))) as Date,

You can add as many alternatives as necessary. You may want to do the Year and Month extraction from the date into a preceding load for simplicity and clarity.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

If i have date field that looks like this

20071103 how can i make it look like 11/03/2007 ?

Chanty4u
MVP
MVP

TRY THIS

Date#(Datefield,'YYYYDDMM'),'DD/MM/YYYY') AS NEWDATE