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

How to remove values from an aggregation?

I have a bar chart with a dimension specified by an expression like:

     class(aggr(FirstSortedValue(value, -time), category), 100)

If the result of the FirstSortedValue expression is 0, I would like to not show those data points in my chart. Is that possible?

1 Solution

Accepted Solutions
sunny_talwar

May be this

Class(Aggr(If(FirstSortedValue(value, -time) <> 0, FirstSortedValue(value, -time)), category), 100)

View solution in original post

4 Replies
Anonymous
Not applicable
Author

If that is the only value then you have the option of not showing nulls. It's in the measure itself as an option.

Not applicable
Author

My values are explicitly 0, not null. I also want to only exclude the entire category if the LATEST value is 0, even if there were previous non-0 values. For example:

value   time    category

0          11:00  c

10        10:00  c

20        11:00  b

0          10:00  b

I want to include b (20,11:00, b) in my chart because the latest value is 20, but I do not want to include c because the latest value is 0 (0,11:00, c).

sunny_talwar

May be this

Class(Aggr(If(FirstSortedValue(value, -time) <> 0, FirstSortedValue(value, -time)), category), 100)

Not applicable
Author

That helps, thanks!