Professional Documents
Culture Documents
Is There Elseif Condition in BODS
Is There Elseif Condition in BODS
Is There Elseif Condition in BODS
My requirement:
If (loopcount =1)
Variable1=value1;
Variable2=value1;
else if(loopcount =2)
Variable1=value2;
Variable2=value2;
else if loopcount =3
Variable1=value3;
Variable2=value3;
It is not entirly clear if you are talking about a mapping or a script function. I assume a script for now.
Code:
If(loopcount=1)
begin
$Variable1=value1;
$Variable2=value1;
end;
elseif(loopcount=2)
begin
$Variable1=value2;
$Variable2=value2;
end;
elseif(loopcount=3)
begin
$Variable1=value3;
$Variable2=value3;
end;
_________________
Werner Daehn
For instance I want to write something like this. if (product = 1 or 2) then (sum(quantity)). what is the
correct syntax.
What worries me a bit is you mixing aggregation functions and scalar functions. Having two queries,
one with the sum(QUANTITY) and the second with an ifthenelse(PRODUCT in (1,2), SUM_QUANTITY,
NULL) is fine.
Or a
sum(ifthenelse(PRODUCT in (1,2), QUANTITY, NULL))
is fine also.
_________________
Werner Daehn