Multiple || statements in Calculated Field

  • 4 August 2017
  • 2 replies
  • 2 views

Badge +11

Hello All,

I got a calculated field which aim is to show the result between the Amount and the currency Rate.

I been using the following formula which does not work as I thought:

If(Rate==0, Amount, If((Currency=="€ - Euro" || Currency=="$ - Dollar" || Currency=="SEK - Krona" || Currency=="CZK - Koruna" || Currency=="CNY - Yuan" || Currency=="INR - Rupee") ,Amount/Rate,Amount))

If I reduce it down to =="Euro || =="Dollar then it works.

I guess this is because the True or False looks only at 2 figures.

According to this post: https://community.nintex.com/thread/15097-issue-with-logical-operators-nested-if-statement

The nested || seem to work for him but it does not work on my case.

Can somebody advise please?


2 replies

Badge +9

Hi ‌,

Try this

If(Rate==0, Amount, If(Currency=="€ - Euro" || Currency=="$ - Dollar" || Currency=="SEK - Krona" || Currency=="CZK - Koruna" || Currency=="CNY - Yuan" || Currency=="INR - Rupee",Amount/Rate),Amount)

Thanks,

Badge +11

That works fantastic happy.png haaahh
I been battling this since 5 hours and no luck ...

What about adding the following to the above calculation:

also if Currency ="£ - Sterling" and the Rate is bigger than 0 then automatically display the Amount entered. 
At the moment, with the above calc, it works fine until the user forgets to leave Rate = 0 when selecting Sterling.

If rate > 0 and £  = #Value error < is showing at moment.

Reply