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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue with Date Formatting

Hello Everyone,

I am having DOB from excel and formatting it like this:

date(Date#(DOB,'DD/MMM/YYYY')) as Test,

After running it I am getting Test as a blank field..any suggestion?

Regards,

Balraj Ahlawat

21 Replies
tamilarasu
Champion
Champion

Could you attach sample file?

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this options

Date(DOB)


If not working load the DOB without any change and check the format in Qlikview how it is read and then use Date(Date#()) to format the date field.



If not working attach sample Excel file, so that it would be easier to identify the issue.

Regards,

Jagan.

Not applicable
Author

Hi,

Try this.



date(Date#(DOB,'DDMMYYYY'),'DD/MM/YYYY') as Test

Not applicable
Author

remove the slash (/)

Not applicable
Author

The other filed which is working fine... What is the format for that field?

Anonymous
Not applicable
Author

Thanks everyone, it worked.

jagan
Partner - Champion III
Partner - Champion III

Hi Balraj,

But most of the times this excel files are generated automatically from some other 3rd party apps, so changing the format manually is not a good practice.  Because everytime the new file comes you have to manually do this.

Instead you read excel file as it is and then check the format of the date field and using Date(Date#()) convert the format.

Hope this helps you.

Regards,

Jagan.

Anonymous
Not applicable
Author

Agreed with you Jagan.

After doing all these settings I came to know that with Date#() function I have to use the excel format of date and then I can use num() & Date() combination.

Instead of doing it manually I am doing it at script level like this:

date(num(date#(DOB, 'Excel Format')),'Required Format') as DOB

jagan
Partner - Champion III
Partner - Champion III

Hi,

I think you have to give the Correct Answers to mine instead of your's.

Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

There is no need of Num() while converting Dates, Date#() itself gives you the numeric date.  So the script should be

date(date#(DOB, 'Excel Format') ,'Required Format') as DOB

Regards,

Jagan.