Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Peek Function & Resident Loads - Need help

I am faily new to Qlikview and here is the code extract, I have already loaded data and placed it into a qvd. Now I am read from this qvd.

Peek_Audit_Master:

LOAD Run_Id,

     Repository_Name,

     Server_Name,

     Informatica_Folder_Name,

     Workflow_Name,

     Mapping_Name,

     Session_Name,

     Session_Start_Time,

     Session_End_Time,

     Status,

     Ts_Etl_Created,

     Ts_Etl_Updated

FROM Peek_Audit_Master.qvd (qvd);

// The below two peek functions correctly give me the values of the min and max dates.

LET vMinSessionDate = Peek('Session_Start_Time',0,Peek_Audit_Master);

LET vMaxSessionDate = Peek('Session_Start_Time',-1,Peek_Audit_Master);

Now I am adding a temp table to do something but I dont't drop this table.

TempTable:

LOAD

Session_Start_Time AS Format_Session_Start_Time

RESIDENT Peek_Audit_Master;

// Problem is with the below two statements, the peek function returns me NULL values when I use these values in a textbox //to display the values.

LET vMinSessionDt = Peek('Session_Start_Time',0,Peek_Audit_Master);

LET vMaxSessionDt = Peek('Session_Start_Time',-1,Peek_Audit_Master);

Any ideas why is it not working?

Thanks,

Shoubhik.

1 Solution

Accepted Solutions
wernerprovelu
Partner
Partner

Hi Shoubhik,

You should place the name of the table between ' '.

LET vMinSessionDt = Peek('Expression1',0,'Peek_Audit_Master');

LET vMaxSessionDt = Peek('Expression1',-1,'Peek_Audit_Master');

regards,

Werner

View solution in original post

5 Replies
wernerprovelu
Partner
Partner

Hi Shoubhik,

You should place the name of the table between ' '.

LET vMinSessionDt = Peek('Expression1',0,'Peek_Audit_Master');

LET vMaxSessionDt = Peek('Expression1',-1,'Peek_Audit_Master');

regards,

Werner

View solution in original post

Not applicable
Author

Thanks a lot for your help Werner! This totally works now. So the reason why the variables - vMinSessionDate and vMaxSessionDate where still getting evaluated correctly though the table name was not in '' was due to qlikview taking the table loaded in preceding statement by default.

Attaching the QVW for reference for other folks who may find it useful.

wernerprovelu
Partner
Partner

Correct.

The TempTable doesn't contain the field Session_Start_Time, so the variable couldn't get evaluated.

anbu1984
Master III
Master III

Are you getting correct Min and Max date? Check attached qvw

Not applicable
Author

This works as well. Thanks so much Anbu. The thing is '' being used for the table name for Qlikview to evaluate the reference correctly.