Discussion Board for collaboration on QlikView Scripting.
I am trying to creating a new calendar which associates next three months dates for a current month.
Ex: Aug month associated to Sep,Oct and Nov dates similarly Sep associated to Oct,Nov and Dec dates and so on.
For creating this, the loop counter value should be sum of number of days in next three months as per my understanding.
so how to calculate the "sum of number of days in next three months" in the while statement.
i.e while iterno()<= Calculation condition.
Please help me out
Thanks in advance
Solved! Go to Solution.
Have a look at the following script:
LOAD MonthStart(AddMonths(MonthYear, 1)) as Start,
MonthEnd(AddMonths(MonthYear, 3)) as End,
LOAD MonthName(Date#(MonthYear, 'MMM-YYYY')) as MonthYear;
LOAD * Inline [
Load min(Start) as minDate,
max(End) as maxDate
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;
LOAD Date($(varMinDate) + IterNo() - 1) as Date
While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
Left Join (Table)