Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement that for some reason doesn't work

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

14 Replies
Not applicable
Author

Hey Sangram Reddy  ,

i took your advice and defined EnCurrency  as dimension but didn't work....

ogster1974
Partner - Master II
Partner - Master II

Need more details than that if you want help on an error.  how about a screen shot of the error your getting if any?  Provide the context and people can help you out better.

Not applicable
Author

Here is a snapshot

1.PNG

Here is a link to the original file

clinton key table7.qvf - Google Drive

ogster1974
Partner - Master II
Partner - Master II

Left a , in.  This should work without an error

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)

)

reddy-s
Master II
Master II

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!

Capture.PNG

Try using a bar chart to test the expression!