Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

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.

View solution in original post

21 Replies
tamilarasu
Champion
Champion

Hi Balraj,

Simply try,

Date(DOB) as Test,

Anonymous
Not applicable
Author

again Blank

Anonymous
Not applicable
Author

I am having one more field of Date from same excel and into same format, which is working fine

But not on this field

amit_saini
Master III
Master III

Try:

load *, Date(Alt(Date#(DOB, 'DD/MMM/YYYY'), Date#(DOB, 'DD/MMM/YYYY'), Date#(DOB, 'DD/MMM/YYYY')), 'DD-MM-YYYY') as Test;

Thanks,
AS

vikasmahajan

check your excel date format whether it is 'DD/MMM/YYYY'  becuase  date# is interpreting date check with this thread

Re: Date#() function: Worng type of output

HTH

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Anonymous
Not applicable
Author

No luck, again blank.

If I am loading the field without any formatting, it is coming into string format...

And If I am applying any formatting, coming blank

vikasmahajan

can you try to change excel format -> Custom -> DD/MM/YYYY and then check

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
tresesco
MVP
MVP

Share your sample excel and let us check how exactly the DOB data is coming from there.

vikasmahajan

Recently I also got such issue resolved with changing format date in excel DD/MM/YYYY and appy date#

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.