Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
dcabello
Partner - Contributor II
Partner - Contributor II

Sometimes Peek() function returns Null() value

Hi everybody,

I was a lot of time thinking wy Peek() function returns a Null() value in my script code...

Here a part of it:

// Ahora definimos las variables para ver la fecha máxima y mínima de cara al montaje de las fechas.
FechasProyecciones:
Load Distinct FechaProy_tmp
Resident Proyecciones_tmp Order By FechaProy_tmp asc;

LET varMinDateProy=num(Peek('FechaProy_tmp',0,'FechasProyecciones'));

After searching the community and without a convincing post came to mind that the problem was precisely the null value. 

Right! the problem was the null values existing in 'FechaProy_tmp' field... so with a little change in the code of the LOAD function the problem was solved. Just were added a WHERE clause.

// Ahora definimos las variables para ver la fecha máxima y mínima de cara al montaje de las fechas.
FechasProyecciones:
Load Distinct FechaProy_tmp
Resident Proyecciones_tmp  Where not IsNull(FechaProy_tmp)
Order By FechaProy_tmp asc;

LET varMinDateProy=num(Peek('FechaProy_tmp',0,'FechasProyecciones'));

I hope will be usefull for everybody!

 

Labels (2)
1 Reply
egma
Contributor II
Contributor II

amazing! I understand why Peek returned null in my script. It was because of what you mentioned. Thanks a lot!! 👋