Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
bimala0507
Partner - Creator
Partner - Creator

Date format Issue

Dear Experts:

Can anyone throw some light on the date issue, I am encountering. To my understanding QlikView stores Date field as Number. I have a date field for which it fails to do so, so in the script, I tried to convert it into Date format by using makedate() function, but no result, in fact the expression return NULL inside the script, however outside it works perfectly fine. AnyIdea how do I handle this date, so that it will be stored in Date format.

Kind Regards,

Bimala

9 Replies
anbu1984
Master III
Master III

Yes Qlikview stores Date field as Number

What is the source of data? Inline data or Table?

EDIT: Can you post what you tried using MakeDate() and sample input.

bimala0507
Partner - Creator
Partner - Creator
Author

It is from the Sybase database.  The formula used is

makedate(Right(inv_date,4),mid(inv_date,(Index(inv_date,'/',1)+1),(Index(inv_date,'/',2))-(Index(inv_date,'/',1)+1)),left(inv_date,(Index(inv_date,'/',1)-1)))

Where inv_date is the date, I am talking about. It has value such as

7/72014

31/7/2014

1/12/2014

it is in DD/MM/YYYY format.

The expression works fine as  an expression.

renjithpl
Specialist
Specialist

May be like this...

Date(MakeDate(SubField(Inv_Date, '/', 3),SubField(Inv_Date, '/', 2), SubField(Inv_Date, '/', 1)) , 'DD/MM/YYYY') as Invoice_Date

Cheers

PradeepReddy
Specialist II
Specialist II

try some thing like this... using makedate() &subfield() functions.

=makedate(subfield(inv_date,'/',3),subfield(inv_date,'/',2),subfield(inv_date,'/',1))

There might be NULL values or junk data in the Database for this field.

anbu1984
Master III
Master III

You can use Date#() like below instead of MakeDate()

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

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Let QV do the work for you:

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

Alt wil return the first valid date in the list of date interpretation (Date#) calls.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Try something like this

Date('7/7/2014','DD-MM-YYYY')

It worked for me.

Not applicable

Hello Bimala,

I had the same problem and found a very simple solution.

I put

  Date (datum, 'DD.MM.YY') as Datefield,

in the load script. Datum is the field which contains the original date from my database, datefield I put into the dimension to have it as x-axes.

Kind regards

Peter

Anonymous
Not applicable

Jonathan,

Alt() wouldn't hurt of course, but from the OP looks it is not necessary.  Just

Date(Date#(inv_date, 'D/M/YYYY'))

Regards,

Michael