Multiple condition within SwitchIf formula - can't crack it

Hello!

I have a table with Amounts and 2 types of currency. I want to simply display the items in “EUR” and in case it is “HUF” I want to convert them. BUT! The exchange rate depends on a date which will come later on during the project (or not). I want to use the exchange rate 1 (EXRate1) until there is no other exchange rate and then use the Exchange rate 2 (EXRate2) from a date (EXRateDate) I give during the project at a later stage.

I am here now but it does not work:

switchif(thisRow.Currency="EUR",thisRow.[Amount],
  thisRow.Currency="HUF".and(EXRateDate=0),thisRow.[Amount]/EXRate1,
  thisRow.Currency="HUF".and(EXRateDate>thisRow.[Date of payment]),thisRow.[Amount]/EXRate1,
  thisRow.Currency="HUF".and(EXRateDate<thisRow.[Date of payment]),thisRow.[Amount]/EXRate2)

Somehow I can not give the “AND” formula for the Condition for the SwitchIf.

Any idea how to crack this?

Thanks a lot in advance!

Hello @Egyesek_Youth_Association .

You have to write this as:

thisRow.Currency="HUF" and EXRateDate=0
or like this:
and( thisRow.Currency="HUF", EXRateDate=0)

The first option is more best practice, but both ways it should work. I didn’t look at your formulas, I noticed this syntax issue. Fixing this should bring you one step closer to solving your problem.

For more help, share a (copy) of your doc (without private information), that makes it a lot easier to help you.

Greetings, Joost

3 Likes

Ooooh I am so stupid… this was it! Now it works. Thank you very much!!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.