Skip to Content
Former Member
Jul 19, 2015 at 03:15 AM

if then else not working


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?