Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a requirement to suppress any row in a chart if any of the expression values is negative. Do I need to put IF in each Expression ? or there's a better way to handle this ?
For example,
| Type | Industry1 Sales | Industry2 Sales | Industry3 Sales | Industry4 Sales | Industry5 Sales | Industry6 Sales |
| A | 95 | 5 | -2 | 0 | 84 | 6 |
| B | 0 | -1 | 2 | 1 | 2 | 0 |
| C | 587 | 56 | 0 | 8 | 95 | 24 |
In above example, I need to show only one row having Type as 'B' since rest of the rows are having negative values.
If I write IF condition in each expression that would be like looking for all 6 Expressions in each Expression.
Perhaps try sum ({<sales = {'>=0'}>}sales)
As far as I see, you either need to add set analysis to each of your expressions to filter only your positive sales, or add if() statements to each of your expressions (which can reference an expression in a separate hidden column, if you want).
See attached
Hi Ivan,
I am using personal edition, please share the expression script ,it helpful for us.
Regards,
Raja.
Raja,
My dimension is Type.
My first expression is FLAG:
If(Sum([Industry1 Sales])=0,1,Sum([Industry1 Sales]))*
If(Sum([Industry2 Sales])=0,1,Sum([Industry2 Sales]))*
If(Sum([Industry3 Sales])=0,1,Sum([Industry3 Sales]))*
If(Sum([Industry4 Sales])=0,1,Sum([Industry4 Sales]))*
If(Sum([Industry5 Sales])=0,1,Sum([Industry5 Sales]))*
If(Sum([Industry6 Sales])=0,1,Sum([Industry6 Sales]))
and I have my Dimension Limits set to

Then I hide the expression

Regards,
Ivan
Ivan shows us a very interesting option.
A more compact FLAG could be
fabs((Sum([Industry1 Sales])>=0)*
(Sum([Industry2 Sales])>=0)*
(Sum([Industry3 Sales])>=0)*
(Sum([Industry4 Sales])>=0)*
(Sum([Industry5 Sales])>=0)*
(Sum([Industry6 Sales])>=0))
Another one is to multiply all expressions in an other column
if there is one 0 value the result will be 0
So you can put play only with this column to shwo the line
best regards
Chris