Discussion Board for collaboration on QlikView Scripting.
run the following script ,I get xx.qvd;
what's wrong with it ?
select 2 as a,4 as b;
select 3 as a,5 as b;
let xx=max(FieldValue( 'a', 1 ));
let yy=max(FieldValue( 'b', 1 ));
if xx<yy then
store test into yy.qvd;
store test into xx.qvd;
Go to Solution.
If you need max and minimum value you need to do like this.
LOAD 2 as a,4 as b AutoGenerate 1;
Load 3 as a,5 as b AutoGenerate 1;
Load Max(a) as Maxa,Max(b) as Maxb Resident test;
let xx=FieldValue( 'Maxa', 1 );
let yy=FieldValue( 'Maxb', 1 );
Drop table tempMax;
You should not use max for assigning to the variables.
Change it like this
let xx=FieldValue( 'a', 1 );
let yy=FieldValue( 'b', 1 );
Also, you may need to call your variables with $...
if $(xx)<$(yy) then
Hope this helps,