Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a condition as if(currency='INR',Sum(Salary),Sum(Salary*0.17))
I want to write this statement through set analysis.
Thanks in advance
The if() function here is before the Sum() function. This means that it will decide whether the sum() command is executed or whether nothing is shown.
Set analysis is used to reduce the amount available to the sum() function. If you had the following if statement:
Sum(if(currency='INR',Salary))
This could be written:
Sum({<currency={'INR'}>} Salary)
This would say that if the currency is not INR don't sum up the Salary.
The if statement you posted says, if the currency (the only currency !!!) is 'INR', then sum up the salary, else times it by 0.17.
You could do this as follows:
Sum({<currency={'INR'}>} Salary*if(currency='INR',1,0.17))
Hope this helps.
Jonathan
Thank you so much, for ur reply it help me ...
Try with this one:
=if(currency='INR',Sum(Salary),Sum(Salary)*0.17)
It means if (currency )='INR' then sum(salary) but if salary is not eqal to 'INR'(else than INR) then sum of (salary)
Thanks.
Narender
FOR--
if(currency='INR',Sum(Salary))
THEN USE--
Sum({<currency={'INR'}>} Salary)
*****************************************************
FOR--
if(currency<>'INR',Sum(Salary))
THEN USE
Sum({<currency-={'INR'}>} Salary)
******************************************************
FOR--
if(currency='INR',Sum(Salary),Sum(Salary*0.17))
THEN USE
Sum({<currency={'INR'}>} Salary) +
Sum({<currency-={'INR'}>} Salary*0.17)
***********************************************************
NOTE - + sign indicates the union, and -= indicates not equal .