Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add expression only when other expression exists

Hi!

I've created a straight table with a number of dimension and one expression. I now wan't to add a second expression (or dimension) which should be visible only when the furstexpression has a value in that column. If I add this dimension as a dimension or an expression, it is going to att rows to the table where the first expression has no value.

A little illustration.

Before:

ProductCategorySum(sales)
shirtclothes50
bagaccessories100
pantsclothes75
shortsclothes30
jacketouterwear80

After:

ProductCategoryquantitySum(sales)
shirtclothes550
bagaccessories1100
pantsclothes575
shortsclothes330
jacketouterwear

1

80
hataccessories4
shoesshoes7

So Sum(Sales) is my first expression and quantity is my second. I don't want to show the rows where Sum(sales) is null. Is there an easy way to do this?

2 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi ,

  this can be done by writing an isnull operation for quantiry, if(isnull(sum(sales) = not null,quantity)

try this

jeffmartins
Partner - Creator II
Partner - Creator II

Hi kimlindell,

You can use quantity expression as if(sum(sales) > 0 ,sum(quantity))

See the attached file

Regards