Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
another (basic?) question:
I have Expr1 and Expr2 as two variables. I want to compare them:
=if(($(Expr1))>($(Expr2)),$(Expr1),$(Expr2))
But QV will no return anything.
The same happens if I use rangemax for this.
Is there any way to compare variables?
Regards.
Hi,
Try this, give this in number tab
=if(Num($(Expr1))>Num($(Expr2)),$(Expr1),$(Expr2))
Regards,
Kiran Rode
+91 8976977897
Hi Kiran,
thanks a lot for your fast answer,but the result still is a '-'
Is there a way to compare the values of two variables?
What is the expression in $(Expr1) and $(Expr2),
and where are you using this if condition, in chart or script or text box?
-Sundar
Try this:
=if((CHR(39)$(Expr1)CHR(39))>(CHR(39)$(Expr2)CHR(39)),CHR(39)$(Expr1)CHR(39),CHR(39)$(Expr2)CHR(39))
-Nilesh
Hello Sundar,
Expr1 and Expr 2 are document variables that have been set up like this:
Expr1:num(sum({<"Date"={"<=$(=date(DateID,'DD/MM/YYYY'))"}>} "Amount"))
Expr2:num(sum({<"Date"={"<=$(=date(DateID-30,'DD/MM/YYYY'))"}>} "Amount"))
And I was comparing them in text box. The values for Expr1 and Expr2 were correctly shown in other two text boxes.
But I was not using exactly the syntax above for the variables and it seems to be the reason for them not to be correctly compared.
Now they are correctly evaluated and compared with rangemax or with if(($(Expr1))>($(Expr2)),$(Expr1),$(Expr2))
Thanks a lot for your help!
Thanks Nilesh for your answer.
I have solved my issue with the above explanation.
Best regards,
Great
-Nilesh
Salto,
Do your Expr1 contain a numeric value ?
if yes, remove the $ expansion sign.
let v1=10;
let v2 = 100;
let v1E= 'v1';
let v2E= 'v2';
let v3 = if(v1 > V2, 2, 3);
let v3E = if($(v1E) > $(v2E), 2, 3);
Both v3 and v3E are = 3
Fabrice
Below these 2 any one will suits according to ur condition
=if($(vExpr1)>$(vExpr2),$(vExpr2),$(vExpr1))
=if('$(vExpr1)'>'$(vExpr2)',$(vExpr1),$(vExpr2) )