-
1. Re: Top N and Others Pie Chart
anil kumar Aug 20, 2016 4:39 AM (in response to anil kumar)Friends, anyone with solution?
-
2. Re: Top N and Others Pie Chart
Simon RuncAug 20, 2016 6:54 AM (in response to anil kumar)
hi Anil,
So here you go...so what I did here was to use sets (which it looks like you'd already investigated!)...
So I create a set off Product Name, returning the Top N (on Sum of Sale). As you want to see the Top N induvidually, I created the following calculation to use as the dimension in the Pie
[Pie Chart DIM]
IF [Top N Products] THEN [Product Name] ELSE 'Others' END
I also created a sort field, so they would go largest to smallest
[Pie Chart DIM Sorter]
IF [Top N Products] THEN [Sales] ELSE 0 END
and I sort on this field.
Now for the filter...As sets are calculated before dimension filters are applied, just having a regular filter wouldn't change the members of the sets. However we can 'bump' the filter up the calculation pipeline by making it a 'context' filter (in the filter option, click 'add to context' and it will be gray to know it's a context filter. There is a (potential) performance cost to using context filters, but unless your data is really large/complicated you'll barely notice.
Hope this does the trick, and makes sense, but if not please post back.
-
Top N Pie with Filtering.twbx 378.5 KB
-
-
3. Re: Top N and Others Pie Chart
anil kumar Aug 20, 2016 9:45 AM (in response to Simon Runc)Hi Simon,
Thanks for the replay, will check you .twbx and revert back.
Regards, Anil
-
4. Re: Top N and Others Pie Chart
anil kumar Aug 20, 2016 10:08 AM (in response to Simon Runc)Hi Simon,
You have used Category as filter which has non dependent fields,
I have filtered using Region the sort order is not uniform. Try changing Region filter and Top N Parameter.Please check attached file.
-
5. Re: Top N and Others Pie Chart
Simon RuncAug 20, 2016 11:05 AM (in response to anil kumar)
So it doesn't matter which dimension we use as a filter, the key is that it needs to be a Context level (or higher) filter
As it is only by adding the filter to context, that it will take affect before the Top N set is calculated.
In the attached I've added it to context, and is now doing what we want.
-
6. Re: Top N and Others Pie Chart
anil kumar Aug 20, 2016 9:54 PM (in response to Simon Runc)Thank you Simon that works like charm .
Regards, Anil.