Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Why we are using Peek() In master calender's?

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.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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















View solution in original post

2 Replies
Anonymous
Not applicable
Author

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















vishsaggi
Champion III
Champion III

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.