Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a doubt why we are using peek() in Mater calender's
below are the variables
LET vMinDate = Num(Peek('MinDate'));
LET vMaxDate = Num(Peek('MaxDate'));
Thanks & Regards,
Nagesh Rao.
Hi.
the master calendar ..
...
....
Temp_Calendar_Range:
LOAD
/*Num(Date#(Min(Invoicedate), 'YYYYMM')) as MinDate,
Num(Date#(Max(Invoicedate), 'YYYYMM')) as MaxDate*/
Min(Order_Date) as MinDate,
Max(Order_Date) as MaxDate
RESIDENT Orders;
//--- Assign the start and end dates to variables
LET vMinDate = Peek('MinDate', 0, 'Temp_Calendar_Range');
LET vMaxDate = Peek('MaxDate', 0, 'Temp_Calendar_Range');
The peek function will take top row from the table : Temp_Calendar_Range ..............
0 for the first record
1 for the second record
Hi.
the master calendar ..
...
....
Temp_Calendar_Range:
LOAD
/*Num(Date#(Min(Invoicedate), 'YYYYMM')) as MinDate,
Num(Date#(Max(Invoicedate), 'YYYYMM')) as MaxDate*/
Min(Order_Date) as MinDate,
Max(Order_Date) as MaxDate
RESIDENT Orders;
//--- Assign the start and end dates to variables
LET vMinDate = Peek('MinDate', 0, 'Temp_Calendar_Range');
LET vMaxDate = Peek('MaxDate', 0, 'Temp_Calendar_Range');
The peek function will take top row from the table : Temp_Calendar_Range ..............
0 for the first record
1 for the second record
From Reference Guide:
Peek('Fieldname', Row, Tablename)
Returns the contents of the fieldname in the record specified by row in the internal table tablename. Data are fetched from the associative QlikView database.
Fieldname must be given as a string (e.g. a quoted literal).
Row must be an integer. 0 denotes the first record, 1 the second and so on. Negative numbers indicate order from the end of the table. -1 denotes the last record read.
If no row is stated, -1 is assumed.
So peek will find the First minimum date from the mindate and the Last date from MaxDate and using these two the calendar will be generated filling the missing dates.