Chart showing a comparison after checking a checkbox - checkbox

I'm trying to figure out how to connect checkbox with chart.
What I need to do is the following:
I have a chart showing two lines (two sets of data, lets name them A and B).
After checking a checkbox "compare A with previous period" or "compare B with previous period" those data disappear and instead of them a suitable comparison is shown.
I know that it is possible to make checkbox dependent chart like here:
https://datastudio.google.com/reporting/23a0d8ac-96c0-42cc-a991-5a21bc7c9962/page/VvbsB?s=rw4uzVA5G9Y
but I don't know how to do it.
I tried looking for the solution on the Internet, but nothing found.
Thank you for your help in advance.

A step by step introduction how to blend data and add checkboxes to show/hide graphs. Also how to do a calculation across datafields in different datasets, which were blended.
Add to the dataset a checkbox with the name compare_a_with_previous_period the field 3days average on/off with
case when compare_a_with_previous_period then 3days average else null end
Depending on the checkbox data is shown in that field or not (null). For blending/joining the data over different dates, a timeshift has to be done. Therefore, create a field date_old with
datetime_add(Date,interval 30 day)
Create an parameter show_differences with range 0 to 1 and add a field show_differences with
case when show_differences = 0 then 0 else 1 end
This will later be used to switch on/off the graph for the difference calculation.
Blend the data with itself using date and date_old as join and range. And rename the 3 day average to 3 days_old
Add the chart and click on the "add metric"
and enter
case when show_differences > 0 then 3days average - 3days_old else null end
to do a calculation between the bend datasets. Under Style set the missing data to "Line Breaks".

Related

Issue with slicer Filtering from different data sets/ columns

I am having a problem trying to understand how to accomplish this. I want to use one set of slicers in my Excel spreadsheet to drill down to specific information. The problem is that I have duplicated Model names under the "Intel" worksheet. The reason is that Model Name could have one or two controllers. I have created all the queries, Power Pivots, and relationships. The link to the file is available here (this is all public data) if someone is willing to take a look and provide the guideline.
PROBLEM:
Due to Model Name's duplication under the "intel" worksheet, I have created a "DUP" column to identify duplicates in my data with the "X." I thought if I made a column “RELATED -Devide by 2” in the Power Pivot “Intel” with the formula =IF([DUP]="X," [RELATED - 12 Month Volume]/2, [RELATED - 12 Month Volume])", I would be able to show correct 12Month Volume based on Volume worksheet. This is partially true. I came to an understanding that I need to use both, “RELATED - 12 Month Volume” and “RELATED -Devide by 2” depending on what slicer I am filtering with
If Filtered by FORM Factor or Vendor, I can use RELATED - Divide by 2 (Orange color as shown below).
Now, if I filter above with Controller (like X710-TM4), this is not good. For Controller Filter, I would need to use “RELATED - 12 Month Volume” (Blue color as shown below), which is NOT suitable for above
How do I accomplish this? One set of slicers and be able to drill down and show correct value based on slicer used
enter image description here
Never mind... I figured it out with the CROSSFILTER measure

Google Data Studio piechart from column with multiple values per cell

I have an excel spreadsheet from a Questionnaire. One of the questions was in checkbox format. The result of this question are held in a single column, and where the user has selected more that one answer, the answers are separated by comma's.
What devices do you own? Mobile, PC, Laptop, Tablet
So in a single cell I get 'Mobile,PC' when these two are selected.
I am using Google Data Studio to visualise the data, but stuck on how to create a graph that shows all the values individually.
At the minute I get a combination for every value. So a value of 1 for 'Mobile,PC' rather than a value for 1 'PC' and '1'Mobile.
Google Data Studio doesn't allow countif statements, so a bit lost.
I have tried to TRIM, COUNIF and REGEX but none have worked.
Count(REGEXP_MATCH(Device, "PC"))
I'm a bit lost on this, tried so many combinations. If someone can put me on the right track I would be very grateful
I don't think you'll be able to achieve that with a pie chart without changing your data source first as it needs one dimension (Device) and then one count metric which your data doesn't seem to support.
You could create 4 metrics like
SUM(
CASE
WHEN REGEXP_MATCH(Device, "PC") then 1
ELSE 0
END
)
And put them into a Stacked bar / column chart. You might need to create a dimension that has a single value to avoid having multiple bars/columns.

Getting two separate values from one column

As mentioned above, I am currently trying to get two separate values derived from one column.
I have a column named statusDate, and I want to know whether if the status have been more than a month. If it's over a month, it will be categorized as Overdue, whereas, less than a month will be categorized as Pending.
This is what I have tried, however, it only gave me a value, either Pending or Overdue. However, I want both for comparison reason.
IF (DATEDIFF('month', today(), statusDate) > 1)
THEN 'OVERDUE'
ELSEIF (DATEDIFF('month', today(), statusDate) < 1)
THEN 'PENDING'
END
Is there anything wrong with my calculated field? Please help, thank you!
I have tried creating two different calculated fields and put both in the row section. However, the result was as following
I want to create a pie chart to show the percentage of Overdue(Long term) vs Pending(Short term).
However, I want both for comparison reason.
With your current setup you could easily compare the two values if you drag the calculated field on rows to get the values in separate rows or on colours if you want two differently coloured line graphs.
If you want to colour your pie chart for each state, use the pie as you have it and drag your calculated field to "Colour". This should split the pie as expected.
You could create two separate calculated fields as U.Y. Fried described although this doesn't really give you any additional possibility that you wouldn't already have with your current calculation.
In the majority of use cases it's a lot easier to compare values if they are in different rows (as you have it, separated by "overdue" and "pending") then comparing values that are in different columns.
Here is one way how to do it, You could create two fields by creating two calculated fields. the first you should call "overdue" use the following expression;
IF (DATEDIFF('month', today(), statusDate) > 1)
THEN 'OVERDUE'
END
for the "pending" use;
IF (DATEDIFF('month', today(), statusDate) < 1)
THEN 'PENDING'
END
IF you'd like to sum them up, return a number, for overdue use;
IF (DATEDIFF('month', today(), statusDate) > 1)
THEN 1
ELSE 0
END
do the opposite for pending.
Also you should take in consideration when it equals to exactly a month, use => for greater or equals, and =< for less or equals, it depends on your business logic.
Hope that this helps you!

Why do I see "Blank" or "0" value at the begging of Stacked Column Chart in Power BI Desktop

For some reason stacked column chart displays "Blank" value even though data behind doesn't have any Blank or '0'.
And my X-axis doesnt have "Type" where I can choose between continuous or categorical:
In a data behind I have 12 months, no blank or 0 :
The (Blank) value can occur even though your underlying data set has no blank values. It is because when you have established relationship between tables, and there are other visuals or filters on the same report page, leading to a joining or filter which results in blank values.
It can be hard to pinpoint sometimes, so the easiest thing you can do is to filter it in the Visual level filters as follows:
As for the X-axis continuous or categorical type setting, it is only available when the data type is numerics or date/time. The MonthShort column you're using is just text to Power BI and it has no idea in what way it should be continuously linked. You need to use the MonthNumber or a date column if you want to achieve so.

How to get an external link to update google sheets automatically?

I have been searching the internet for a while now and i can't really seem to find any answers for my query what i am looking for is this...
Runescape Grand Exchange Market
For example:~
Runite Bar Is "14,378 coins"
But it changes from time to time depending on the "game economy"
How can i use this number to auto update in google spreadsheet?
For example 1 bar is 14,378 coins. If i choose to put 2 Bars I would like the price of the item to be changed also so it's 28,756 coins.
What i have done at the moment is to make this Runite Bar you require certain items such as:
1. Runite Ore x1
2. Coal x8
I have set the value to auto update when i choose to purchase 100 Runite Ores It will automatically update how much Coal i need which would be "800" but what i want is to auto update the "PRICE" of the BAR
So if I choose to purchase:~
300 Runite Ore (1) - 10,975 - i would like this also to be updated automatically.
2400 Coal (x8)- 2,504 - i would like this also to be updated automatically.
Cost would be: 4,043,700 Coins - This is the total and should be updated automatically.
But if somebody tells me how to get price of an external site i can maybe do the Runite Ore & Coal myself i hope..lol
Runite Bar Website = Runescape Wikipedia - Rune Bar - as you can see it says "Exchange price" THAT is what i want in spreadsheet to be updated automatically.
Best Regards
Antartika
Please try:
=substitute(left(index(importxml("http://runescape.wikia.com/wiki/Rune_bar","//td"),15,1),6),",","")*1
the //td part should import the entire table (the one in the middle of the page). It is XPath code that seems to me not at all well documented but ZVON might help.
index 15,1 then takes the fifteenth row and the first column (ie 14,573 coins) of that table. These are the parameters to change to select other cells from that table.
left strips off the coins part, but since a function that manipulates text results in a string, so the comma is a 'character' rather than formatting feature. However
substitute replaces the , with ""(ie with nothing) so that when we multiply by one (*1) we get a number that we can then multiply again by however many bars are involved.

Resources