Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert yyyymmdd to dd/mm/yyyy

Hello All,

I have an issue while converting a date from 'yyyymmdd' to 'DD/MM/YYYY'.

I am using the below formula in my Load script:

Date(alt(Date#(DATE, 'yyyymmdd')), 'DD/MM/YYYY') as Date

It gives me the correct answer in my table on qlikview.

Ex. 21/10/2015

However when I export the table in excel it becomes like this:

21//2015.

Also, when i try using the expression =if(Date= today(), Date) to get the data of only today, my table becomes empty.

Any idea why?

Many Thanks,

Hasvine

1 Solution

Accepted Solutions
sujeetsingh
Master III
Master III

Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as NewDate

View solution in original post

7 Replies
swuehl
MVP
MVP

Your parsing format code should be

Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as Date

HirisH_V7
Master
Master

Hi,

Try this

= Date(date#(Date,'YYYY-DD-MM'),'MM/DD/YYYY')


Thanks,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
raman_rastogi
Partner - Creator III
Partner - Creator III

correct  'yyyymmdd' to 'yyyyMMdd' or 'YYYYMMDD'


=Date(alt(Date#(DATE, 'yyyyMMdd')), 'DD/MM/YYYY') as Date

sujeetsingh
Master III
Master III

Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as NewDate

Not applicable
Author

Thanks swuehl thanks everyone for your help.

It is working fine now.

Cheers,

Hasvine

jonathandienst
Partner - Champion III
Partner - Champion III

Swuehl has answered your question.

The alt() in your expression is redundant, as you have not provided an alternate value if the Date#() evaluates to null. It does not break the expression though.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
quriouss
Creator III
Creator III

Just to note the reason for this (I fell into the same trap for a time);

'mm' is the internal format code for minutes, 'MM' is for Months.  (There is no difference between d and D, so Qlik 'knows' what to do in that case).