Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
I found the problem
I had to use
where OrderGenKey='$(vKey)';
instead of where OrderGenKey=$(vKey);
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.
QyDate Count the lines of specific column by:
QyDate = FieldValuecount(FieldName(1,'OrderKey'));
I found the problem
I had to use
where OrderGenKey='$(vKey)';
instead of where OrderGenKey=$(vKey);