
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as NewDate


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your parsing format code should be
Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as Date

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try this
= Date(date#(Date,'YYYY-DD-MM'),'MM/DD/YYYY')
Thanks,
Hirish
“Aspire to Inspire before we Expire!”


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
correct 'yyyymmdd' to 'yyyyMMdd' or 'YYYYMMDD'
=Date(alt(Date#(DATE, 'yyyyMMdd')), 'DD/MM/YYYY') as Date


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Date(alt(Date#(DATE, 'YYYYMMDD')), 'DD/MM/YYYY') as NewDate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks swuehl thanks everyone for your help.
It is working fine now.
Cheers,
Hasvine


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
