Problem with showing top-n results in an horizontal bar chart with series
I have an horizontal bar chart. Let's say the Y axis is factories, while the X axis is number of incidents in each factory in some time period.
I want to show only the 10 factories with the most incidents, sorted by number of incidents.
When I'm not using any series, the simplest way of doing that is to sort on COUNT of ID_INCIDENT, and then limit rows to 10. Very easy. Here is a dummy example:
The problem comes when I add a series. Incidents are classified by urgency: LOW, MEDIUM, HIGH. (I have a URGENCY_INDEX beast mode that assigns a numeric value to each one.)
When I add the series (only as a series, without sorting by it) the COUNT of ID_INCIDENT sorting ceases to work correctly. The rows are no longer ordered by total incidents:
Is there a way to have an horizontal stacked bar chart that is sorted by totals, but has a series, and where the series are sorted within each bar by URGENCY_INDEX?
I attach a zipped .csv with the sample data to reproduce the problem.