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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Srinivas
Creator
Creator

Date Format Issue..

Hi Folks,

I have excel in that date have two formats so qlikview shows two different formats,

But i want in one format like 'MM/DD/YYYY' , Could you please help on this.

Date.PNG.png

this format i want....

Regards,

Munna

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

I update the above post now check with the script that is.

Alt( Date(Date#( Date , 'M/D/YYYY' ),'MM/DD/YYYY'),

      Date(Date#( Date , 'MM/D/YYYY'),'MM/DD/YYYY'),

      Date(Date , 'MM/DD/YYYY')) AS NewDate,

View solution in original post

9 Replies
Not applicable

Not sure I fully understand what you're asking, because the dates in the excel seem to have the same format...If you just want to include the leading zero values for the single digit dates something like the expression below should work. 


date
(date#(YourDateField, 'M/D/YYYY'), 'MM/DD/YYYY')

ashfaq_haseeb
Champion III
Champion III

Hi may be like this.

LOAD

Alt(Date#(Date, 'M/D/YYYY'), Date#(Date, 'DD/MM/YYYY'), Date#(Date, 'MM/DD/YYYY'), Date#(Date, 'YYYY-MM-DD'), Date#(Date, 'D/M/YYYY'), 'Invalid Date') as ValidatedDate,

  Date,

     [Sales Quantity]

FROM

(ooxml, embedded labels, table is Sheet1);

Regards

ASHFAQ

its_anandrjs
Champion III
Champion III

You have to use Alt function see the example

LOAD

  Date,

Alt( Date(date#( Date , 'M/DD/YYYY' ), 'MM/DD/YYYY'),

       Date(date#( Date , 'DD/MM/YYYY' ), 'DD/MM/YYYY')) AS NewDate,

     [Sales Quantity]

FROM

[22052014\DateIssue.xlsx]

(ooxml, embedded labels, table is Sheet1);

its_anandrjs
Champion III
Champion III

Update the script now check

See the below load script that contains the Alt script use in the load script

LOAD

Date,

Alt( Date(Date#( Date , 'M/D/YYYY' ),'MM/DD/YYYY'),

      Date(Date#( Date , 'MM/D/YYYY'),'MM/DD/YYYY'),

      Date(Date , 'MM/DD/YYYY')) AS NewDate,

[Sales Quantity]

FROM

[DateIssue.xlsx]

(ooxml, embedded labels, table is Sheet1);

And you get the below field

ndate.png

Srinivas
Creator
Creator
Author

it's not working..i want to see all dates..

All.PNG.png

All should be same format...

its_anandrjs
Champion III
Champion III

Update now check the script

Try this one

Alt( Date(Date#( Date , 'M/D/YYYY' ),'MM/DD/YYYY'),

      Date(Date#( Date , 'MM/D/YYYY'),'MM/DD/YYYY'),

      Date(Date , 'MM/DD/YYYY')) AS NewDate,

Srinivas
Creator
Creator
Author

Hi Anand,

In your screen showed correct but when i tried sam code in my script it showed wrong...see below screen.

All.PNG.png

But i want all date should be 2/3/2014.. like way

Could you please help on this..

Advance & Thanks

Munna.

its_anandrjs
Champion III
Champion III

I update the above post now check with the script that is.

Alt( Date(Date#( Date , 'M/D/YYYY' ),'MM/DD/YYYY'),

      Date(Date#( Date , 'MM/D/YYYY'),'MM/DD/YYYY'),

      Date(Date , 'MM/DD/YYYY')) AS NewDate,

Srinivas
Creator
Creator
Author

Thank you a lot Mr.Anand, It's working now.

Regards,

Munna