Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to compute data for a variable according to the following instruction :
let GradientNormalisé = if (if(bitor(s_GradientBrut>30,Pdev>0.01)),1,0),30,d_Gradient;
It doesn't work at all : syntax error.
Maybe I should use another instruction ... could you please help ?
What I would like to have is :
GradientNormalisé variable set to 30 if GradientBrut >30 and Pdev>0.01
GradientNormalisé variable set to 30 if GradientBrut <=30 and Pdev<=0.01
GradientNormalisé variable set to d_Gradient if GradientBrut <=30 and Pdev>0.01 GradientNormalisé variable set to d_Gradient if GradientBrut >30 and Pdev<=0.01 | |
If( (GradientBrut >30 and Pdev>0.01) or (GradientBrut <=30 and Pdev<=0.01) , 30,
if(
(GradientBrut <=30 and Pdev>0.01) or ( GradientBrut >30 and Pdev<=0.01) , d_Gradient ) ) | |
Hi Cedric,
maybe you're looking for the boolean xor-operator:
If(GradientBrut>30 xor Pdev>0.01, d_Gradient, 30)
LOAD
*,
If(GradientBrut>30 xor Pdev>0.01, d_Gradient, 30) as [GradientNormalisé];
LOAD
Round(Rand()/10, 0.0001) as Pdev,
RecNo() as GradientBrut,
Ceil(Rand()*100) as d_Gradient
AutoGenerate 100;
hope this helps
regards
Marco
Please close this thread if there are no further questions.
thanks
regards
Marco