Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Conversion Problem

Hi All,  I am facing a problem with the date conversion.

I have this excel file in which i have a date column in which i intend to have dates in 'DD/MM/YYYY' format.

But when i import this file into qlikview it appears in 'MM/DD/YYYY'.

Converting these dates using the :

date(date#(date,'DD/MM/YYYY'),'DD/MM/YYYY') as date lends me null values in the frontend.

I also tried using date(makedate(subfield(date,'/',3),subfield(date,'/',2),subfield(date,'/',1)),'DD/MM/YYYY')

but still i am getting null values.  I am not able to fetch dates correctly to the application. I think its a problem of excel file, but i am not able to identify it correctly and solve it.

Any help would be appreciated. 

Thanks in advance. 

P.S. : Attaching the excel file which contains date column.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Nadeem,

My script was as follows:

//Just to check whether the month is being detected correctly

Load *,

month(newdate) as M;

//Creation of dates required from the exisiting dates

Load*,

month(date) as month,

date(makedate(SubField(date,'/',3),SubField(date,'/',1),SubField(date,'/',2)),'DD/MM/YYYY') as newdate;

//Loading date from the excel file

LOAD

date(date,'DD/MM/YYYY') as date

FROM

doubt.xlsx

(ooxml, embedded labels, table is Sheet3);

View solution in original post

26 Replies
Anonymous
Not applicable
Author

Just this should suffice :

     date(date, 'DD/MM/YYYY' )

Anonymous
Not applicable
Author

Hi,

its format issue,not interpretation issue

try:

date(date,'DD/MM/YYYY') as date

Regards

Neetha

Not applicable
Author

Hi...But this isn't working as well.

I am still getting dates in 'MM/DD/YYYY' format.

Not applicable
Author

Hi...But this isn't working as well.

I am still getting dates in 'MM/DD/YYYY' format.

I need the dates in 'DD/MM/YYYY' format

maxgro
MVP
MVP

this is what i get loading your excel file

SET DateFormat='MM/DD/YYYY';

LOAD date FROM doubt.xlsx

(ooxml, embedded labels, table is Sheet3);

1.jpg

SET DateFormat='DD/MM/YYYY';

LOAD date FROM doubt.xlsx

(ooxml, embedded labels, table is Sheet3);

2.jpg

Not applicable
Author

Exactly....

My date is 1st May 2015(01/05/2015),1st june 2015(01/06/2015) and so on....

The '1' is the date part..not the month....

But its showing otherwise and thats the problem.

Anonymous
Not applicable
Author

Hi Shashi,

I used your excel spreadsheet:

script:

LOAD date
FROM

(
ooxml, embedded labels, table is Sheet3);

in UI Date:

form.png

for me its working fine

Regards

Neetha

Not applicable
Author

Hi Neetha,

The output u showed is coming for me too...Th issue i am facing is when i want to display in 'DD/MM/YYYY' format.

The 01 is the date.  05,06,07 etc.. are the months..

When i apply date(date,'DD/MM/YYYY') to it i still get in 'MM/DD/YYYY' format.

Its treating the 01 as month instead of date.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Shashi Nadiger wrote:

The 01 is the date.  05,06,07 etc.. are the months..    

Not true. In the Excel file you attached, 01 is the month and 05, 06, 07 are the days, so you are getting exactly what is in your source file.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein