cancel
Showing results for 
Search instead for 
Did you mean: 

if then else not working

Former Member
0 Kudos

Hi guys

This sounds like a dumb question. I am trying to do an if then else statement without much traction.

In my table there is a Sales column, that obviously is a number field and I got another column Status, that either has value Returned or is blank. I created a calculated dimension (Sales - Return) and used the following if then else statement

if {Status} = "Returned" then 0 else {Sales}

The value 0 shows when the Status is Returned but somehow it is blank where Status is blank

Further, I thought maybe something wrong with my Sales column, then I reversed it, just to check with the following statement

if {Status} = "Returned" then {Sales} else 0

Now, it shows the Sales value against Returned but does not show 0 against blank statuses, which shows that my Sales column is ok to be used.

What is happening, any clue?

Bala

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Found a solution, thanks for anybody who cared to look, I used the following statement instead

if IsNull({Status}) then {Sales} else 0

Answers (0)