Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear experts,
I am following the Qlik Sense Cookbook second edition to learn more about the tool, and in the Script session, I followed the instruction on the book, with a script provided in the book, see as follow:
and I click load data, below show up:
However, when I check the data in data manager, it shows below:
Would be great if someone can tell me there I did wrong? thank you experts!
Hi Puffy,
Please change to below script, then try:
SET vMinDate = DATE(Floor(MakeDate(2010,1,1)),'DD/MM/YYYY'); SET vMaxDate = DATE(Floor(Today()),'DD/MM/YYYY'); LET vDiff = $(vMaxDate) - $(vMinDate) + 1; t1: LOAD DateID, Year(DateID) as Year; LOAD RecNo() - 1 + $(vMinDate) as DateID, RecNo() as recno AutoGenerate $(vDiff);
It works in my desktop.
Thanks.
Aiolos Zhao
Hi Puffy,
Please change to below script, then try:
SET vMinDate = DATE(Floor(MakeDate(2010,1,1)),'DD/MM/YYYY'); SET vMaxDate = DATE(Floor(Today()),'DD/MM/YYYY'); LET vDiff = $(vMaxDate) - $(vMinDate) + 1; t1: LOAD DateID, Year(DateID) as Year; LOAD RecNo() - 1 + $(vMinDate) as DateID, RecNo() as recno AutoGenerate $(vDiff);
It works in my desktop.
Thanks.
Aiolos Zhao
Thanks, it works now.
Good day!
Hi
I had this problem and the answer here solved it for me, thankyou . If I could trouble you for further clarification.
The issue seemed to have been the using of "Let" instead of "Set" so that the let command set the variable to a value and the set command set it to an expression. My issue is that why did it not work when using the LET when value would have been '2010-01-01'. If the value is hard coded in the LOAD then it worked as it did with using the SET. vMinDate never changes so why hard coded and expression works but LET evaluation does not confuses me.
Thankyou in anticipation.