Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
HPW
Contributor II
Contributor II

Value from qvd-table in IF..ENDIF clause

Hi guys,

I'm saving today's date in a qvd table as information for the last data update by using following function.

LOAD * INLINE [LastDay];
Concatenate(Dashboard_Risk_Actual3) LOAD
Today() as LastDay
AUTOGENERATE(1);
STORE Dashboard_Risk_Actual3 INTO Dashboard_Risk_Actual3.qvd (qvd);
DROP table Dashboard_Risk_Actual3;

Now I want to use that date in an IF..ENDIF clause like 

IF LastDay<>Today() THEN .......

How can I get the value from the qvd as paramter for my IF..ENDIF clause.

I hope anybody is having an idea for that.

Best regards Hans-Peter

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

To get a value from a qvd you needs to load the qvd with/without certain where-clauses and/or any transformation like aggregations and then picking your wanted value per peek() or fieldvalue() or lookup(). If your load returned just one record or an easy to predicting structure it's not difficult to fetch the wanted value - if not it could become complicated ...

Your scenario looked as if it could be solved easier just by assigning the last run-time or the max. value of a date/key to a variable, like:

if vLastRun < today() then
   let vLastRun = today();
   ... further statements ...
end if

- Marcus

View solution in original post

2 Replies
marcus_sommer

To get a value from a qvd you needs to load the qvd with/without certain where-clauses and/or any transformation like aggregations and then picking your wanted value per peek() or fieldvalue() or lookup(). If your load returned just one record or an easy to predicting structure it's not difficult to fetch the wanted value - if not it could become complicated ...

Your scenario looked as if it could be solved easier just by assigning the last run-time or the max. value of a date/key to a variable, like:

if vLastRun < today() then
   let vLastRun = today();
   ... further statements ...
end if

- Marcus

HPW
Contributor II
Contributor II
Author

Thanks for such an easy solution. I was not aware that values of variables are kept in the qvw.