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

Announcements
Qlik Unveils New Agentic Capabilities Across Analytics, Data Engineering, and Trust: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

Calendar

Hi,

I am having an issue with the script below to create a temp calendar. Strangely, it used to work but now it is coming with an error message.Not sure how to resolve it.

Temp: 

Load 

               Min(SaleDate) as MinDate, 

               Max(SaleDate) as MaxDate 

Resident SALES; 

 

Let vMinDate = Num(Peek('MinDate', 0, 'Temp')); 

Let vMaxDate = Num(Peek('MaxDate', 0, 'Temp')); 

 

TempCalendar: 

LOAD 

$(vMinDate) + Iterno()-1 As Num, 

Date($(vMinDate) + IterNo() - 1) as TempDate 

AutoGenerate 1 While $(vMinDate) + IterNo() -1 <= $(vMaxDate);

DROP Table Temp;

Thanks

Shamit

Labels (1)
12 Replies
andrespa
Specialist
Specialist

This is driving me crazy, it's seems a really basic stuff but I'm not able to understand what's going on. Still not evaluating the variable:

andrespa_0-1771497491345.png

 

marcus_sommer

What's the way to view the variable-content? Maybe there is something wrong. What about with this:

trace min = $(vMinDate) & max = $(vMaxDate);

directly after the assignment?

Further take a look if there are more places where such logic are applied maybe overwriting the previous results. Helpful may also be to query the temp-table again, like:

check: load *, rowno() as RowNo resident TempCalendar;

Does it fail or showing more as one record or is in other ways unexpected?

andrespa
Specialist
Specialist

Solved. It was indeed an incorrect way of showing the variables on the trace. The actual solution was the floor(). 

Thanks Marcus, you've helped me a lot!