Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dual() vs. Date() --> bug or feature?!?

Hello community,

here's a simple example:

LET var= Dual('TEST',42814);
LET var2= Date(42814);

LOAD '$(var)' - 5 as FIELD1 AutoGenerate 1;
LOAD  $(#var) - 5 as FIELD2 AutoGenerate 1;
LOAD '$(var2)' - 5 as FIELD3 AutoGenerate 1;
LOAD  $(#var2) - 5 as FIELD4 AutoGenerate 1;

Why is there a difference between FIELD1 and FIELD3?:

I would expect the same result for FIELD1 and FIELD3 --> either the dual() - value will be passed through or not.

In my eyes this is just inconsequential behaviour...


Any ideas?


(using QV 11.2 SR15)


1 Solution

Accepted Solutions
4 Replies
swuehl
MVP
MVP

Format the date not the same way as your standard date format, so Qlik can't interpret the text expansion as date in your LOAD.

Assuming you are using german date format as default, try

LET var2= Date(42814,'MM/DD/YYYY');

swuehl
MVP
MVP

And yes, it's a feature:

Automatic Number Interpretation

Frank_Hartmann
Master II
Master II

LET var= num(Dual('TEST',42814));

LET var2= Date(42814);

LOAD '$(var)' -5 as FIELD1 AutoGenerate 1;

LOAD  $(#var) - 5 as FIELD2 AutoGenerate 1;

LOAD '$(var2)' - 5 as FIELD3 AutoGenerate 1;

LOAD  $(#var2) - 5 as FIELD4 AutoGenerate 1;

hope this helps

Anonymous
Not applicable
Author

thank you for your answers.

So I will solve it like that:

LOAD dual('$(var)',$(#var) - 5) as FIELD5 AutoGenerate 1;