It's the first time I use Google Data Studio and I'd like to add a control (dropdown menu) to my report that allows me to control which series to show in a Combo chart.
1. Data
Data is organized in a (Google Sheets) as shown below:
Year
Safer Buildings (Annual)
Safer Buildings (Cumulative)
Safer People (Annual)
Safer People (Cumulative)
2021
10282
100126
56461
524152
2020
11655
89844
57425
467691
2019
13743
78189
68120
410266
2018
9332
64446
52807
342146
2017
4904
55114
34971
289339
2016
1006
50210
11928
254368
2015
1723
49204
8317
242440
2014
518
47481
2541
234123
2013
7015
46963
34491
231582
2. Expected output table
I'm not sure a different table is needed besides the one provided above.
3. Chart
I created a 'Combo chart' based on the data above, as shown below.
Chart setup:
More specifically, I'd like to add a control (dropdown menu) to my report that allows me to select between two entries 'Safer Buildings' OR 'Safer People' in a way that:
If I select 'Safer Buildings' I will see, in the chart shown in the picture above, the bar chart for 'Safer Buildings (Annual)' (blue) AND the line chart for 'Safer Buildings (Cumulative)' (cyan).
If I select 'Safer People' I will see, in the chart shown in the picture above, the bar chart for 'Safer People (Annual)' (magenta) AND the line chart for 'Safer People (Cumulative)' (orange).
I know I can achieve something similar by switching on 'Optional metrics' but I cannot find a way to implement it with a dropdown menu.
4. Issue/Attempt at solving
In order to achieve what I'd like to do. I tried to simplify the task and to focus, initially, only on 2 metrics 'Safer Buildings (Annual)' (bar chart) and 'Safer People (Annual)' (bar chart).
First of all I created a parameter named 'impact_metrics', defined as follows:
Then, I created a dummy field named 'Impact metrics (dummy)', define as follows:
Finally, I created another field named 'Test1', defined as follows:
I went back to the Combo chart and I modified the setup as shown below:
Now, if I select a different parameter in the 'Parameters' field highlighted by a red rectangle in the picture above, the Combo chart gets updated as expected (see below).
However, now I don't know:
how I can show both the bar chart for 'Safer Buildings (Annual)' AND the line chart for 'Safer Buildings (Cumulative)' when selecting 'Safer Buildings' in the 'Parameters' field highlighted by a red rectangle in the picture above.
If I edit 'Test1' field as follows, I get an error (see below).
how can avoiding having to select a parameter in the Combo chart setup and have instead a dropdown menu to do that.
5. Report
At this link you can find the editable Data Studio report.
Any advice is very welcome! Thank you.
Related
Background
I have a Google Data Studio report showing Google Forms survey results based on different demographics. I need to protect the anonymity of people that responded to the form so I do not want to show the results if fewer than 5 people responded from either an individual demographic category or from a combination of categories.
In my Google Data Studio report I have a stacked bar chart showing the breakdown of how people responded to the question. The chart has a dimension that can be selected from a data control and then it is possible to drill down into the data. I then have 9 separate dropdown list data controls to allow the user to filter by different demographics.
Stacked bar chart from Google Data Studio:
Gender
Hair colour
Eye colour
Question response
Man
Blond
Blue
Man
Brown
Blue
Probably
Man
Black
Brown
Not at all
Man
Blond
Blue
Probably
Man
Brown
Green
Definitely
Man
Black
Brown
Neutral
Man
Blond
Blue
Definitely
Man
Brown
Brown
Probably
Question
How do I apply a filter to the dimension so the dimension does not show if there were fewer than 5 responses for that dimension? I still want it to show the data for the dimension if there were >5 responses for the individual segments of the stacked bar chart
Attempt
I am able to assign null values if there were fewer than 5 respondents from an individual demographic in my data prep. I am also able to ensure the dropdown list data controls do not show categories where there were fewer than 5 responses by applying a filter to each data control. However if I apply the same filter to the chart, it filters out any segment of the stacked bar chart where there were fewer than 5 responses rather than if there were 5 responses to the whole dimension/demographic
Filter configuration:
Resulting bar chart with no data:
Expected output
When Hair colour is selected as 'Blond' only in the data control, the bar chart should show a stacked bar for 'Man' but no stacked bar for 'Woman' as there are fewer than 5 responses for 'Woman'
Sample
Data Set (Google Sheets)
Google Data Studio report
If I select Hair colour = blond from the data control, there are 7 responses from men and 2 from women. I want the responses from men to display but not for women as there were only 2 women with blond hair in our sample which is less than 5. If I apply a filter exclude record count < 5, then it removes men from the chart as well as women because there were fewer than 5 responses for each survey option ('Definitely', 'Probably' etc.).
I managed to solve this using a version of Nimantha's answer to this question: How can I re-categorize any counts < n in Google Data Studio?. I basically wanted to achieve the same thing but on a stacked bar chart and I wanted to remove the redacted responses completely from the chart.
As in Nimantha's answer to the question above, I created a calculated field containing COUNT(Gender) in my main data source. The additional step was I then created a simple bar chart with Gender as the dimension and Count Gender in the metric field. The key was to apply a filter to this chart which excludes that count gender calculated field if the count is less than x (in my case 5).
I then blended that chart with my original chart (both using the same data source) with a left join on Gender. I then re-created the stacked bar chart using the same fields (gender in dimension, question response in breakdown dimension and record count as the metric. This chart inherits the filter from the helper chart to remove the dimension if gender count is less than 5.
I've updated my original sample to show this in action here: https://datastudio.google.com/reporting/4476440c-f322-4087-8d76-013a0d59835c
Click here to view screenshot of working version
I have created a chart and instead of numbers I want to show dates in xAxis and I want to set the progress of the bar as per the difference of days between two dates, for example on the first column in Week 1 inside W1 I want to show blue bar from 01/02/2022 to 10/02/2022 something like that, is it possible to do in Chart Js? I have attached the stack blitz link as well. Basically, I want to manage it using dates.
StackBlitz Demo
I have a times series graph in Google with drill down options for the date fields as well as two custom fields. When I go into view or edit mode and hover over my graph to select custom metrics, they are not showing up.
My time series graph
Settings for my graph
Some of my other times series and graphs on the same page have optional metrics that show up when I hover over them. All the other graphs in my report don't have this problem.
Things I have tried.
Refreshing Data Source
Refreshing the page
Enabling and re enabling the custom metrics
I'm not sure what else to do as I am still somewhat new to using this tool. Any hints would be much appreciated!
A couple of reasons:
1) Text Box
One possibility is that the Text Box may be ordered ahead of the Time Series Chart, thus blocking the top of the chart (Right click on the Text Box and set the Order to Send to back), however, when the chart is selected, it should show, thus #2 should do the trick:
2) Chart Header
It may be currently set to Do not show; it can be changed by heading to the Style Tab of the respective chart, scrolling down till the Chart Header section and selecting Show on hover from the drop-down.
Google Data Studio Report and a GIF to elaborate:
I am creating a SSRS Report (PPT export) with multiple charts and fixed number of pages. Each page contains multiple charts. I want to display different charts in the same page location based on a condition.
Now I know that ,we can Hide/Show a chart by specifying an expression for visibility attribute, but this will only Hide/Show the single type of chart in a preassigned location.
Just to reiterate
If Condition1=True
Display Chart1 at location (0,0)
Else
Display Chart2 at location (0,0)
Note: Chart1 and Chart2 are generated from different datasets
Thanks in Advance!
This is very simple to accomplish.
Create both charts and place them on top of each other in the report designer. Set up your visibility settings to only show one based on your criteria and as only one gets rendered, they will not interfere with each other or the rest of the report layout.
I Think position property for Chart is not available, so we can not manage chart position directly with any position parameter. but there is work around. create your all charts (multiple charts) in your report design, position them as you want and change their visible property as per your conditions.
e.g. if Chart1 to be displayed at position1 and position 2 based on condition, there will be 2 charts in your report RDL one at position1 and another at position2. manage each charts visible property as per condition, you should achieve what you need.
this is tried by me earlier.
I am stuck with one of the most irritating problem of SSRS. In my chart, I am displaying all months for months with data and without data. Reason being User wants to see all the months.
now where there is no data in any month then in the legend, SSRS is by default putting Series 1(dont know why called it Series 1)
Instead it should display "Declined", "Re-Directed", "Upheld" but what I am getting is
"Series 1", "Declined", "Re-Directed", "Upheld"
http://imgur.com/abWGg67
http://imgur.com/22yFYta
My problem is, User wants to see months with no data but she is not ready to see Series 1 in the legend and I have tried everything but couldn't figure out the solution.
Please help:
I know it's old but I found another way to hide Series1 on the chart.
Click on a Series
Go to the Properties pane, Appearance > (Hidden) option.
Click on the Expression button (looks like Fx)
Enter in the following:
=IIF(IsNothing(Fields!GROUPING_OPTION.Value)=TRUE, TRUE, FALSE)
Please see this image for an example:
ScreenshotOfMyReport
Sorry- I don't have enough reputation to embed the image yet.
I found the answer to my question. I have updated my Stored Procedure. I wrote a Case Statement in Stored Procedure stating that where it's blank in the chart then show it as a 'No Data Yet' in the Legend.
http://imgur.com/seVxA5Z
Image might explain better :)