Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to load a single field SQL result into a Qlikview variable and use this variable in another SQL load.
e.g.
variable = Select foo from table:
Select baa from table where baa < $(variable)
If it's possible, please tell me the right syntax.
thx in advance
Tom (Newbee)
Hi, based in your example the script must be something like
tmp:
Select foo from table;
let variable = peek('foo',0,'tmp');
drop table tmp;
DATA:
Select baa from table where baa < $(variable);
rgds
Hector, thx
for some reason I don't understand, the function peek doesn't work. Maybe my example describes not my real need. I need a limitation of selected rows by a value of another table.
But I got a result with function Fieldvalue.
So the Syntax is
Select foo from table1;
let variable = FiledValue(foo,1);
Select baa from table2 LIMIT $(variable);
Hi, here's an example how I use peek for a similar task:
PARTS_date:
First 1LET
vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date')));