Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Everyone ,
I am trying to run the following IF statement :
IF(EnCurrency='NIS',Num(sum( {$< TRANS_TYPE = {N}>} NIS_TRANS_TOTPRICE )* -1,
IF(EnCurrency='$',Num(sum( {$< TRANS_TYPE = {N}>} DOLLAR_TRANS_TOTPRICE )* -1,
IF(EnCurrency='EUR',Num(sum( {$< TRANS_TYPE = {N}>} CURRENCY_TRANS_TOTPRICE)* -1 )))) ;
EnCurrency= CURRENCY
for some reason this If statment doesn't
Hi Jhonatan,
I tried plotting the dimension "EnCurrency" and the measure with the expression:
IF(EnCurrency='NIS', Sum( {$< TRANS_TYPE = {N}>} NIS_TRANS_TOTPRICE )* -1,
IF(EnCurrency='$', Sum( {$< TRANS_TYPE = {N}>} DOLLAR_TRANS_TOTPRICE )* -1,
IF(EnCurrency='EUR', Sum( {$< TRANS_TYPE = {N}>} CURRENCY_TRANS_TOTPRICE)* -1
)
)
)
Works absolutely fine!
Try using a bar chart to test the expression!
IF(EnCurrency='NIS',Num(sum( {$< [TRANS_TYPE ]= {'N'}>} NIS_TRANS_TOTPRICE )* -1,
IF(EnCurrency='$',Num(sum( {$< [TRANS_TYPE] = {'N'}>} DOLLAR_TRANS_TOTPRICE )* -1,
IF(EnCurrency='EUR',Num(sum( {$< [TRANS_TYPE ]= {'N'}>} CURRENCY_TRANS_TOTPRICE)* -1 )))) ;
In which context are you trying to use this statement? In the script or in a chart? If it's in a chart, what are the chart dimensions?
Besides that, I think the syntax is not valid, double check the opening and closing brackets.
IF(EnCurrency='NIS', Sum( {$< TRANS_TYPE = {N}>} NIS_TRANS_TOTPRICE )* -1,
IF(EnCurrency='$', Sum( {$< TRANS_TYPE = {N}>} DOLLAR_TRANS_TOTPRICE )* -1,
IF(EnCurrency='EUR', Sum( {$< TRANS_TYPE = {N}>} CURRENCY_TRANS_TOTPRICE)* -1
)
)
)
Hi Jhonatan,
If this condition is in the script it wont work at all, but if its in the UI side as an expression, make sure that one of the dimensions is "EnCurrency".
Hey Swuhel
i am trying to use this is as shippment returns caculation,
NIS = means New Isareli Shekel ( Israeliy coin) name.
EnCurrency = type of CURRENCY.
i tried to run the script you wrote down and didn't work ....
Why don't you try this. It will perform better than a nested if statement to...
pick(match(EnCurrency,'NIS','$','EUR'),
// NIS
, Num(sum( {$< TRANS_TYPE = {N}>} NIS_TRANS_TOTPRICE )* -1)
//
, Num(sum( {$< TRANS_TYPE = {N}>} DOLLAR_TRANS_TOTPRICE )* -1)
// EUR
, Num(sum( {$< TRANS_TYPE = {N}>} CURRENCY_TRANS_TOTPRICE)* -1)
)
Hey Reddys310 ,
i defined it as a Measure on my report,
and in the script i have defined the EnCurrency on the script:
CURRENCY_TABLE:
LOAD * INLINE [
Currency,EnCurrency,Rcurrency
₪, NIS,сикель
€, EUR,ЕВРО
$, $,доллар
];
Hi Jhonatan,
Is EnCurrency one of the dimmensions in your visualization? If not you need to have that as a dimmension to make the expression work.
Hey Ogster1974,
tried your script but didn't work.
Or you need to select exactely one value from field EnCurrency (or from fields Currency, Rcurrency).