pdvsa
asked on
Switch
Experts, I am trying to make a switch statement out of the below. I get a wrong number of arguments. The IIF statement works fine separately but I need to add the Nz part and I assume that Switch is the solution.
=Switch(Nz([Gustav]=""),"0 after pmt",IIf([CurrencyID]=1,[G ustav],[Gu stav]*[Exc hangeRate] ))
thank you
=Switch(Nz([Gustav]=""),"0
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for your response.
Glad to help :)
or you could use it like:
=Switch(NZ(Gustav],"") = "", "O after pmt", [CurrencyID] = 1, [Gustav], True, [Gustav] * [ExchangeRage])
I always finish out my SWITCH( ) function calls with a final pair that includes a TRUE and a value to use if none of the other conditions are met. This guarantees that if none of the original conditions are met, I will still get a value returned that I can filter on.
=Switch(NZ(Gustav],"") = "", "O after pmt", [CurrencyID] = 1, [Gustav], True, [Gustav] * [ExchangeRage])
I always finish out my SWITCH( ) function calls with a final pair that includes a TRUE and a value to use if none of the other conditions are met. This guarantees that if none of the original conditions are met, I will still get a value returned that I can filter on.
Open in new window
It's basically like a one line Select Case statement.