Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
i am trying to write some conditions in the script as follow :
table_calucle :
LOAD code_article,
if (val1>=val2 and val1>=val3, then val1
elseif val2>=val1 and val2>=val3 then val2
elseif val3>=val1 and val3>=val2 then val3
)
as longeur
resident base_article;
if someone could help me it would be great
thanks
Hi,
Try this..
table_calucle :
LOAD
code_article,
if (val1>=val2 and val1>=val3, val1,
if (val2>=val1 and val2>=val3,val2,
if(val3>=val1 and val3>=val2,val3))) as longeur
resident base_article;
@settu_periasamy gave you the correct syntax using if(), but it looks like you are trying to get the max of a range of values and rangemax() could be a sleeker approach.
Consider replacing your if() with this.
table_calucle :
LOAD
code_article,
RangeMax(val1,val2,val3) as longeur
resident base_article;
Hi,
Try this..
table_calucle :
LOAD
code_article,
if (val1>=val2 and val1>=val3, val1,
if (val2>=val1 and val2>=val3,val2,
if(val3>=val1 and val3>=val2,val3))) as longeur
resident base_article;
@settu_periasamy gave you the correct syntax using if(), but it looks like you are trying to get the max of a range of values and rangemax() could be a sleeker approach.
Consider replacing your if() with this.
table_calucle :
LOAD
code_article,
RangeMax(val1,val2,val3) as longeur
resident base_article;