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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Prink
Contributor III
Contributor III

Variables in data load editor

Hi,

I have created a variable in script. And I'm trying to use that variable in a where condition. I'm unable to get the result value from that variable.

 

let vd = 'max("Business Date")';
check:
load "Business Date",Sum(Usage)
Resident source
where "Business Date" = '$(vd)'
group by "Business Date";

I tried $(vd) and also '$(vd)'. Both are not working. I couldnt get the max date assigned in where condition.

Kindly provide me correct syntax.

 

Thanks !!

 

10 Replies
Vegar
MVP
MVP

If you want it to be dependent on the user selections you can't implement the logic in the script, you will need to do it in  the expression inside your charts and graphs.

 

Load your data without aggregations and where clauses and use this expression.

 

=SUM({<[Business Date]= {'$(=maxstring([Business Date]))'}>}Usage)