Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
In a stacked bar chart (and in a pie chart) where there's one dimension with many possible categories (e.g. dimnesion = "Products", categories: "House","Beauty","Bathroom"...), is there a way to limit the presentation to specific categories you define (e.g. House and Bathroom) and show "Others" as well (as you would in a normal dimension limits option).
What I did was to just define the categories I wanted in the expression of the chart, but this way I can't show the total for the others...
Thanks for your help!
Hi,
a calculated dimension may help, try this:
if( Products = 'House' or Products = 'Beauty' or Products = 'Bathroom', 'Others')
HtH
Roland
Sorry: better is this:
if( Products = 'House' or Products = 'Beauty' or Products = 'Bathroom', Prducts, 'Others')
Roland,
Your answer is correct, but there is a shorter way using match() function. And, posibly aggr() is needed too:
aggr(if(match(Products,'House','Beauty','Bathroom', Products, 'Others'), Products)
Regards,
Michael
Hi Michael,
you are right, forgot about this shorter way.
But I don't see the aggr()-fanction to be used. There are no aggregations to be done.
Regards
Roland
Agree, in this case it should work without aggr, so I said "possibly". So, this should be enough:
(if(match(Products,'House','Beauty','Bathroom', Products, 'Others')
(Just a habit, in my cases aggr is almost always needed.)
Regards,
Michael
Michael, Roland - thanks a lot for your replies.
Michael - are you sure this is the right syntax? (what you wrote in your last message)
I get error in calculated dimension
when i try to close the last parens I get the curly red line underneath it, and when I don't - the first parens is highlighted in red. Very confusing.
Thanks again
I always mess the '()'... This should work:
if(match(Products,'House','Beauty','Bathroom'), Products, 'Others')
Let me answer, Michael won't be angry.
His expression is missing a ') ' after 'Bathroom' -->
if(match(Products,'House','Beauty','Bathroom' ) , Products, 'Others')
So long
R
Oh, lost 😉
I'm never angry