Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

billuran
Contributor

Convert .TXT file Date Format

Hello All, I have a text document that has a date format as YYYY-MM-DD.

I have a .csv file that has a date lookup relation as MM/DD/YYYY. How do I change the date format YYYY-MM-DD to be able to have the correct look up relationship as the .csv file. IE MM/DD/YYYY.

Thanks!

Tags (1)
3 Replies
jpenuliar
Valued Contributor III

Re: Convert .TXT file Date Format

Hi Bill,

Maybe something like below:

Date(MakeDate(subfield('2016-07-27','-',1),subfield('2016-07-27','-',2),subfield('2016-07-27','-',3)),'MM/DD/YYYY')

Jonathan

Re: Convert .TXT file Date Format

Try this

          date(date#('2016-07-27', 'YYYY-MM-DD'), 'MM/DD/YYYY')

or       date(date#(your_date_field, 'YYYY-MM-DD'), 'MM/DD/YYYY')

There are some useful posts on dates and date formatting here

Get the Dates Right

The Date Function

Why don’t my dates work?

sureshqv
Esteemed Contributor III

Re: Convert .TXT file Date Format

u can set  here also

SET DateFormat='MM/DD/YYYY';

or else   As colin

Try this

          date(date#('2016-07-27', 'YYYY-MM-DD'), 'MM/DD/YYYY')

or       date(date#(your_date_field, 'YYYY-MM-DD'), 'MM/DD/YYYY')

Community Browser