Can I have a bar chart that is both stacked and grouped? - bar-chart

The bounty expires in 6 days. Answers to this question are eligible for a +200 reputation bounty.
user74934 wants to draw more attention to this question.
I have a bar chart in Superset where I have two different columns configured under BREAKDOWN. Both columns divide the data into two parts, so I end up with four different breakdowns. Example: I have sales data for two different cities, and the sales data are broken down by product (2 different products).
I would like to compare sales between the cities, so I would like to group the one column (sales). However, for each city I want to add up total sales by adding both products, so I would like to stack those bars.
So far, I can only find a way to EITHER stack or group the bars, which gives me either four bars per month, or a single bar - neither of which is useful. Is there a way to have a chart that is both grouped and stacked at the same time depending on the column used for the breakdown?
This is what it looks like now:

Related

How to get sum of attributes from different tables MYSQL

I am new to MySQL, currently I've been trying to create a column in a table that contains the total of payment an individual has to pay. For references, the first picture is how I want the tables to look like (in the big picture).
What i want is that in the column of total_to_pay, it automatically sums up the value of price from Mobile_Subscription, value of price from TV_Subscription and value of payment_from_past from History. So I want it to basically look something like this:
I want to know if such thing is possible and if not how can i make something similar?
I searched on Google this problem but all I could find was how to sum all values from 2 different columns, when what I wanted is to sum 2 (or 3) specific values from 2 different column from 2 different tables.

SSRS 2016 - Customise Output based on values in data

I have been tasked with creating a report that needs to display in chronological order, but within that report there is data from 2 sources that covers 2 different areas of business.
What I have been asked for, is when the type of business changes, the header row is repeated with the correct column headings for that type - i.e. :
Type 1 :
Order Ref / Sales Exec / Contract Term / Despatch Date / Agreement Type / Hardware ID
Type 2 :
Order Ref / Sale Type / Contract Term / Despatch Date / Start Date / Hardware ID
Also each header row should have a different background color by the type also (although I think I can do this already). Within the report the header row could be needed multiple times if the types flip from one to the other as the report traverses through the orders in date order.
I was first looking at adding a grouping by type, but that will interrupt the chronological flow of course.
Just to complicate matters there are different numbers of item columns for each type in reality, but I might have to just leave blanks where we have less columns for one type.
Or is there some way of having sub reports that are reporting for an "outer loop" of the actual order references?
It's almost like I need to construct the report in some sort of looped code.
How can I achieve this?
You can do this using table grouping. The outermost group would be by day and then within that you would group by type. Within that you can add a group that isn't grouped by anything so that it will list all the details depending on the number of records in the dataset. So the design would end up looking something like this:
This is how it looks when you run it.
Of course you can play around with how everything is organized, but the general structure should work for you. Or at least point you in the right direction.

Creating a Stacked Pareto in SSRS 2016

I work in a manufacturing environment. We record defects (scrap and rework) on parts for 9 different reasons (eg Weld Fault). I need to chart this for a dashboard in SSRS.
In SSRS, I am pulling the data out into a stacked bar chart so I can see total defects per defect type (and it's split by Scrap / Rework) , and this works great, however I want it to appear as a Stacked Pareto format (so, most common on the left, and reduces down to the right)
I'm relatively new to SSRS so this is a learning curve. I'm guessing I need to do something with the Running Value - I've looked at using this to sort by, but according to the error received I cannot sort by RunningValue.
Does anyone have any suggestions as to how I could create a stacked Pareto?
Assuming you already have a stacked barchart, but it is not sorted largest to smallest.
All you should need to do is right mouse click on your category group, then click on the sorting tab then enter into the Expression something like
=Count(Fields!Type.Value)
or
=Sum(Fields!Items.Value)
Depending on whether your bars sum a field or are counts of records in your dataset. It should be the same as the series calculation, ie what highlighted below
To make largest to smallest you will need to change the sort order to Z to A.

Grouping multiple items on a page

I am trying to create a SSRS report that will have multiple items such as charts and tablix on that will group by Customer.
For example we have 3 different charts which use different data sets but we want to show a group of charts by customer like Customer A has X amount of incidents, X amount of Problems and X amount of Service Request (but we want them displayed in charts)
I tried a list grouping but it keeps amending the whole group of charts data sets.
You have to combine a few different features to get this functionality.
First of all, when you have multiple elements such as charts, you'll want to insert a rectangle first and then drag the charts into it. This keeps their layout consistent.
Next, you will need to insert a Table. Delete the header row and two of the columns so you're left with just a single cell and the "Details" group. Set this to be grouped by customer ID. Also set it to page break between instances of the group.
Finally, drag the entire rectangle into this table cell. Now the entire contents of the rectangle will repeat with a separate customer on each page. The table inherently filters all the objects inside it to that customer.

SSRS stacked bar chart multiple series, utilizing category groups for different date fields

The source data is a SSAS cube, which contains information about tickets, particularly priority, date opened, and date closed.
Each ticket has a priority and date opened value, though the closed value may be null or another placeholder value (subject to change).
A ticket is represented by a record in the source table with the mentioned attributes, and in the cube each of the dates are linked to a date dimension record (with the exception of the potentially null closed date).
I utilize a named-set to limit the data from the cube to the past 13 months.
The desired result is a multiple column stacked bar chart, the Series Grouping should be Priority thereby creating the stack with Y-axis representing a ticket count dependent on the X-axis which is a grouping by month.
Each month grouping should have a stack dependent on the opened and closed dates.
The closest I've come is utilizing the category expressions but I have beginners knowledge in this.
Any suggestions in either the way I'm pulling the dataset from the cube with MDX to alleviate the creation of the chart or features of the SSRS chart control are welcome.
Thank you.
After exhaustive investigation, it seems that this is a common problem when using Role-Playing Dimensions in your OLAP cube. That is multiple joins from a single fact back to a single dimension. For example when attempting to generate a report with Date on an axis, where the Date dimension is the Role-Playing Dimension, there is a non-user friendly experience.
This article helped in providing a solution to modeling the data in a slight different way.
http://visual-intelligence.nu/how-to-avoid-role-playing-dimensions-in-ssas/