Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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:
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?
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!