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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Importing Dates from Excel into QV

I am having trouble getting the date from excel into qlikview. There a few threads already, but im having trouble following them. So i have a date field in excel that is formatted the following way:

=DATE(2011, 3, 1)

that equals 3/1/2011, which is different from what i am getting in QV.

how i imported my excel file was by opening the "edit script" screen. then at the bottom i clicked the button called "table files" and added my excel file to the script. that is how i got this code:

LOAD WID,

Date,

Description,

Who,

Number,

Category

FROM

[WorkLog.xls]

(biff, embedded labels, table is Zach$);



Now i think i have to do something to the date at this point. In the report i did change the number type of the Date field to be a date, but that is not the right date.

5 Replies
IAMDV
Master II
Master II

Hi Zachmurray,

QV is generally very good at interpreting the dates, because it stores the dates in to integers/decimal points. I mean in your case it should store the date as 40,603 assuming that there is no time and if there is time then it will store 40,603.xxxxxx something like this...

And if QV don't understand the date then it converts it to string. So I would recommend you to convert your Date Field in to Date Format. You can use Date function in the load script.. something like this...

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

I hope this helps!

Cheers.

Not applicable
Author

LOAD WID,

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

Description,

Who,

Number,

Category

FROM

[\WorkLog.xls]

(biff, embedded labels, table is Christian$)



This is giving me an error. can you see anything wrong with it?

erichshiino
Partner - Master
Partner - Master

If you want to interpret a string as a date, the syntax is : Date#(FIELD,'DD/MM/YYYY') as Date

In your case, Date#(Date,'DD/MM/YYYY') as Date

What kind of result did you get with your original script?

Not applicable
Author

I actually got it to work by using Date(Date,'DD/MM/YYYY') as Date without the "#".

Thanks for the direction

IAMDV
Master II
Master II

Hi Zachmurray,

I am glad to know that you got it working. Please can you mark the post answered? This will be useful reference for other community users...

Cheers!