Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
apthansh
Creator
Creator

Date formatting

I have the date format as in attached file.

I ma trying to change the format ,but no results.

Using the below expression -  

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


Date(Date, 'YYYY-MM-DD') as  Date



any help please.,Thank you

7 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

You can try something like this.

264980.PNG

Good Luck

Oscar

apthansh
Creator
Creator
Author

PFA file ....something is wrong...

oscar_ortiz
Partner - Specialist
Partner - Specialist

What format is the Date in?  MDY or DMY?

oscar_ortiz
Partner - Specialist
Partner - Specialist

Depending upon which format your original date is you could do something like this.

264980-1.PNG

LOAD

  Reference,

  Project,

  Note,

  [Previous Note],

  Author,

  Date,

  Date(Date#(Date, 'M/D/YYYY hh:mm'), 'MM/DD/YYYY') as MDYFmtDate1,

  Date(Date#(Date, 'M/D/YYYY hh:mm'), 'YYYY/MM/DD') as YMDFmtDate1,

  Date(Date#(Date, 'M/D/YYYY hh:mm'), 'DD/MM/YYYY') as DMYFmtDate1,

  Date(Date#(Date, 'D/M/YYYY hh:mm'), 'MM/DD/YYYY') as MDYFmtDate2,

  Date(Date#(Date, 'D/M/YYYY hh:mm'), 'YYYY/MM/DD') as YMDFmtDate2,

  Date(Date#(Date, 'D/M/YYYY hh:mm'), 'DD/MM/YYYY') as DMYFmtDate2,

  [Client name]

FROM

[Date Test (1).csv]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Good Luck

Oscar

Kushal_Chawda

set your timestamp variable format

SET TimestampFormat='M/D/YYYY h:mm';


Now load your csv


Data:

LOAD Reference,

     Project,

     Note,

     [Previous Note],

     Author,

     Date,

     [Client name]

FROM

[Date Test.csv]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

abc_18
Creator II
Creator II

Try like this

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

FROM

(txt, codepage is 1252, embedded labels, delimiter is ' ', msq);

dberkesacn
Partner - Creator III
Partner - Creator III

Hi,

this would be useful for you, check the pdf as well.

Get the Dates Right

Cheers,

Daniel