Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I want to create a list of data based on two date values as input.
Start date = 18/02/2016
End date = today (25/02/2016)
The end date is dynamically, i.e. depends on which date today.
The output should be
18/02/2016
19/02/2016
20/02/2016
21/02/2016
22/02/2016
23/02/2016
24/02/2016
25/02/2016
Could you please give me the solution how to write a script in Qlikview?
Thanks and best regards,
Cornelis
Look into Master calendar: Creating A Master Calendar
Min can be determine by the user and max can be Today() in the below code:
QuartersMap:
MAPPING LOAD
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
AUTOGENERATE (12);
Temp:
Load
min(OrderDate) as minDate,
Today() as maxDate
Resident Orders;
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
YeartoDate(TempDate)*-1 as CurYTDFlag,
YeartoDate(TempDate,-1)*-1 as LastYTDFlag,
inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12,
date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,
ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
u cn chk script below
Hi Francesca,
Indeed, this is the solution.
Add this at the top of the script editor and the the listbox with OrderDate gives the required output.
Thanks!
Orders:
LOAD *INLINE
[
OrderDate,
1-1-2016
]
;
Thanks!
Thanks!