Problem with IF statements

How would I get these IF statements written differently to account for the 3 scenarios it describes? The approach seems to work in other scenarios, and has worked for one of the IF statements, too…
{{if(5.amount != null & 6.amount = null; “-” + (5.amount / 100))}}{{if(5.amount = null & 6.amount != null; “-” + (6.amount / “100)”))}}{{if(5.amount != null & 6.amount != null; “-” + ((5.amount + 6.amount) / 100))}}
image

Thanks!

U have a problem with the formatting
try this-

if(
5.amount != null && 6.amount != null,
(5.amount + 6.amount) / 100,
if(
5.amount != null,
5.amount / 100,
if(
6.amount != null,
6.amount / 100,
null
)
)
)

2 Likes

What is the problem with the formatting, do you think? I need these amounts to come back negative, if you’re referring to the “-”

your first if ends without taking other if condition in consideration which is causing you the problem

3 Likes

My end result:
image

It was challenging because you have to go back and clean up code a bit, but once you see the symbols have a background, you know it’s going to work.

Thank you, Thakur!

Hi @Charle_Remen :wave:

I’m just quickly jumping in to say congrats on getting the hold of the if statements with the assistance of @ThakurHemansh :clap:

Thanks a lot for sharing your progress and your final setup with the rest of us. This could be super helpful to many other searching for similar info in the future :pray:

2 Likes