How can I make a Geo Chart display one specific country and its regions in Google Data Studio? - google-data-studio

A Geo Chart usually shows entire world.
How to show one country's region and color them according to my data?
Also how can I group my data in a table so Data Studio can actually represent regions of my country?
e.g. I have 3 countries and number of accounts in each country, in what column can I put regional data for my country?
country
account_number
region
russia
324
??
kazakhstan
5785
??
america
2342
??
I have added a report, Data Studio recognizes the country by country code, but from there it's not clear how to highlight regions by numbers:
Google Data Studio Report

One way it can be achieved is by using:
Chart Type: Google Maps
Bubble Location: region
Bubble Colour: country
Metric: metric
Created an Editable Google Sheet with the sample data below with some random values for the metric field as well as adding a few values for the region field:
country
account_number
region
metric
Russia
324
Moscow
54
Russia
325
Saint Petersburg
36
Russia
326
Krasnodar Krai
14
Kazakhstan
5785
Almaty
31
Kazakhstan
5786
Astana
57
Kazakhstan
5787
Kyzylorda
58
United States
2342
New York
28
United States
2343
California
99
United States
2344
Texas
30
Editable Google Data Studio Report as well as a GIF to elaborate:

Related

Create a table in Data Studio that shows current/latest value and a previous value and compares them

I have two sheets in a Google Sheet that has historical data for some internal programs.
programs
high level data about each program
each program has data for all of the different report dates
metrics
specific metrics about each program for each report date
Using my example data, there are 4 programs: a, b, c, and d and I have reports for 1/1/2020, 1/15/2020, 2/3/2020, and 6/20/2020.
I want to create a Data Studio report that will:
combine the data on report date and program
show a filter where the user can select which previous report date they want to compare against
the filter should show all of the previous report dates and default select the most recent one
for example, the filter would show:
1/1/2020
1/15/2020
2/3/2020 (default selected)
the filter should only allow selecting one
a table showing values for current report date and values for the report date selected in the above filter
Here is an example table using the source data in my above linked Google Sheet when the report is initially loaded and the filter has 2/3/2020 default selected:
report date
program
id
l1 manager
status
current value
previous report date value
direction
6/20/2020
a
1
Carlos
bad
202
244
up
6/20/2020
b
2
Jack
bad
202
328
up
6/20/2020
c
3
Max
bad
363
249
down
6/20/2020
d
4
Henry
good
267
284
up
If the user selects 1/1/2020 in the filter, then the table would show:
report date
program
id
l1 manager
status
current value
previous report date value
direction
6/20/2020
a
1
Carlos
bad
202
220
up
6/20/2020
b
2
Jack
bad
202
348
up
6/20/2020
c
3
Max
bad
363
266
down
6/20/2020
d
4
Henry
good
267
225
down

How can I create an option to filter out NULL values in a field?

I have used a Google Sheet to create a data source for a dashboard in Google Data Studio:
Account_Number
Process_Date
Business_Unit
Budget_Reference
Vender_Name
1000001
7/1/2017
113111
0
ABCD Plumbing
1000002
7/9/2017
114122
0
ACME-1 Electric
1000003
6/14/2017
114223
1
1000004
5/11/2017
112444
1
Shark Industries
1000005
5/12/2017
113334
2
Cyberdyne Systems
1000006
5/11/2017
114440
2
Ollivander's Wand Shop
1000007
5/9/2017
120001
2
1000008
5/17/2017
120009
2
Wayne Enterprises
1000009
4/4/2017
120005
3
Fun City - USA
1000010
4/15/2017
120014
3
1000011
3/11/2017
120111
3
I used it to build a table and now want to use an advanced filter control to filter out rows containing blank vendor names:
Account_Number
Process_Date
Business_Unit
Budget_Reference
Vender_Name
1000001
7/1/2017
113111
0
ABCD Plumbing
1000002
7/9/2017
114122
0
ACME-1 Electric
1000004
5/11/2017
112444
1
Shark Industries
1000005
5/12/2017
113334
2
Cyberdyne Systems
1000006
5/11/2017
114440
2
Ollivander's Wand Shop
1000008
5/17/2017
120009
2
Wayne Enterprises
1000009
4/4/2017
120005
3
Fun City - USA
Google Data Studio Report:
Use either approach (1 or 2), based on the requirement:
Flexible - Checkbox: Provides the option for users to switch NULL values on or off
Fixed - Filter: Use if the aim is to hide NULL values
1) Flexible: Control Box
To create a toggleable feature, a checkbox control can be used, with the control field:
IF(Vendor_Name IS NULL, FALSE, TRUE)
The calculated field above uses the IF function to detect NULL values in the Vendor_Name field, which then filters data based on the checkbox selection:
⊟: (Default) all data
☑: Data excluding NULL values
▢: Only NULL values
To view all data, click the ↶ Reset button on the report header.
Optionally, use report links to ensure that users start with a default view:
NULL values excluded by default
Only NULL values shown by default
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:
2) Fixed: Filter
To hide NULL values from users (without the ability for users to toggle), this filter would do:
Exclude Vendor_Name is NULL
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to demonstrate:

Build complex queries with multiple fields in cloudant

Date State | City | Zip | Water | Weight
-------------------------------------------------------------------
01/01/2016 Arizona Chandler 1011 10 ltr 40 kg
01/04/2016 Arizona Mesa 1012 20 ltr 50 kg
06/05/2015 Washington Spokane 1013 30 ltrs 44 kg
06/08/2015 Washington Spokane 1013 30 ltrs 44 kg
What I want are complex queries, like I want to know average water, weight by passing a city or state or ip for a date range or month, or any field or all fields.
I am not sure how to go about this. Read about map reduce, but cant guess how will I get above output
If you have link for examples which covers above scenarios that will also help.
Thanks in advance
So first we need to model your structured data in JSON. Something like this would work:
{
"date": "2016-01-01",
"location": "Arizona Chandler",
"pressure": 1101,
"water": 10,
"weight": 40
}
Here's your data in a Cloudant database:
https://reader.cloudant.com/so37613808/_all_docs?include_docs=true
Next we'd need to create a MapReduce view to aggregate the a specific field by date. A map function to create an index whose key is the date and whose value is the water would look like this:
function(doc) {
emit(doc.date, doc.water);
}
Every key/value pair emitted from the map function is added to an index which can be queried later in its entirety or by a range of keys (keys which in this case represent a date).
And if an average is required we would use the built-in _stats reducer. The Map and Reduce portions are expressed in a Design Document like this one: https://reader.cloudant.com/so37613808/_design/aggregate
The subsequent index allows us to get an aggregate across the whole data set with:
https://reader.cloudant.com/so37613808/_design/aggregate/_view/waterbydate
Dividing the sum by the count gives us an average.
We can use the same index to provide data grouped by keys too:
https://reader.cloudant.com/so37613808/_design/aggregate/_view/waterbydate?group=true
Or we can select a portion of the data by supplying startkey and endkey parameters:
https://reader.cloudant.com/so37613808/_design/aggregate/_view/waterbydate?startkey=%222016-01-01%22&endkey=%222016-06-03%22
See https://docs.cloudant.com/creating_views.html for more details.

Microsoft Chart control in WinForms app - how to display a composite chart

I need to display a chart showing per-month sales; I want to display the volume as one column and the sales as a different column (both in each month). The problem, however, is that I have multiple sales values for each month, one per currency. I wanted this to be a stacked column, showing the different values one on top of the other.
My problem is that when I make the second series stacked column, it stacks it on top of the first value. I don't want that. Can someone explain how to configure this correctly?
Example data:
Jan 2011: qty 30, sales: 10 USD, 15 GBP, 0 EUR
Feb 2011: qty 40, sales: 20 USD, 5 GBP, 5 EUR
Mar 2011: qty 80, sales: 30 USD, 10 GBP, 10 EUR
I am using the default chart control in Visual Studio 2010. This is a WinForms application, not web.
Use the StackedGroupName custom property.
To place multiple series in the same stacked group, assign the same
name to them.
To show multiple stacks, assign different names to multiple series.
From the samples project:
// Set the first two series to be grouped into Group1
chart1.Series["LightBlue"]["StackedGroupName"] = "Group1";
chart1.Series["Gold"]["StackedGroupName"] = "Group1";
// Set the last two series to be grouped into Group2
chart1.Series["Red"]["StackedGroupName"] = "Group2";
chart1.Series["DarkBlue"]["StackedGroupName"] = "Group2";

Get state/province from geonames data?

I downloaded these databases for US and CA from GeoNames. The date looks like this:
5881639 100 Mile House 100 Mile House 51.64982 -121.28594 P PPL CA 02 0 917 America/Vancouver 2006-01-18
5881640 101 Mile Lake 101 Mile Lake 51.66652 -121.30264 H LK CA 02 0 917 America/Vancouver 2006-01-18
5881641 101 Ponds 101 Ponds 47.811 -53.97733 H PNDS CA 05 0 18 America/St_Johns 2006-01-18
I want to use this data for a city-picker, but I want to display to province or state beside it. Doesn't look like this data contains that information. Is there some way to retrieve that? Or is there a better DB that includes that?
You use the data in the columns for the admin codes these are actually ids that link to the admin codes table (there are separate data sets available for the admin codes) it is very straightforward.
Check the Geonames forums for more info.
http://forum.geonames.org/
Use the datasets here: geocoder.ca which include city name and state / province name in the same file.
If you want to stick with your data, you can use Google's Geocoding API, as in the first answer here:
Google Maps: how to get country, state/province/region, city given a lat/long value?
to get information based on latitude and longitude. This will be a lot of work, though, especially for a city-picker.

Resources