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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
brijesh1991
Partner - Specialist
Partner - Specialist

Date format issue

How to convert Date format : yymmdd into dd/mm/yyyy???

Your ideaes are highly appreciated. . .


Thanks and Regards,

Brijesh

Labels (1)
1 Solution

Accepted Solutions
rbecher
Partner - Master III
Partner - Master III

Use upper format codes:

Date#('110425', 'YYMMDD')

'mm' is for minutes..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine

View solution in original post

4 Replies
datanibbler
Champion
Champion

Hi Brijesh,

I know of two ways:

- You could set the date_format you want on the "Main" tab of the script - or set it just before that code and reset it afterwards or wherever

- You could use the DATE# function - that would probably have to look like this:

>>> Date(Date#, [field], 'yyyymmdd'), [required_format]) as ... <<<

The DATE# function just takes the data that  comes from your data_source and interprets as a date - that format_parameter is the format in which it comes - and automatically makes it the internally used numeric - then you can go and format it in whatever date_format you want to have displayed.

HTH

Best regards,

DataNibbler

brijesh1991
Partner - Specialist
Partner - Specialist
Author

Hey DataNibbler thanks. . .

But if my date is 110425 then it should be converted to 25/04/2011.

First two digits year, next two digits month and last two digits day.

So you mean to say if I will use this:: Date(Date#('110425', 'yymmdd'),'DD/MM/YYYY') 

then Date should be 25/04/2011 ideally!

But qlikview gives : 25/01/2011

rbecher
Partner - Master III
Partner - Master III

Use upper format codes:

Date#('110425', 'YYMMDD')

'mm' is for minutes..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
brijesh1991
Partner - Specialist
Partner - Specialist
Author

Thanks Ralf. . .

It worked!!!