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: 
seWork
Contributor III
Contributor III

where condition with vars without $ symbol

Hi all I'm trying to use a variable in loop script for where condition

The problem is that the variable is holding only 1 value for each run

for some reason the variable value for $(vKey) = '-' and the variable value for vKey = the wanted value

how could I use the variable in the where condition in order to filter the load?


For gKey = 1 to QyDate

let vKey = Peek('OrderGenKey',$(gKey),'OrderKey');

TempOrderLines:

First 1

Load Distinct OrderGenKey,ID Resident Order_line

where OrderGenKey=$(vKey);

store TempOrderLines into OrderLinesGen/TempOrderLines$(vKey).QVD;

Drop table TempOrderLines;

Next gKey;

1 Solution

Accepted Solutions
seWork
Contributor III
Contributor III
Author

I found the problem

I had to use

where OrderGenKey='$(vKey)';

instead of where OrderGenKey=$(vKey);

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

What is QyDate? If it's a variable then how does it get its value? If it's a field then that's an error. You can't use a field name in this context as it can't be evaluated to a value.


talk is cheap, supply exceeds demand
seWork
Contributor III
Contributor III
Author

QyDate Count the lines of specific column by:

QyDate = FieldValuecount(FieldName(1,'OrderKey'));

seWork
Contributor III
Contributor III
Author

I found the problem

I had to use

where OrderGenKey='$(vKey)';

instead of where OrderGenKey=$(vKey);