Multiple layers on a Flourish choropleth map - mapping

I made a map of US counties with Flourish, showing different colors in each county depending on some variable. (A choropleth map.) This all works now and looks great.
I want to add layers. By selecting some control option, the value shown in each county changes. So the same map can show income, or population, or voting trends for each county.
Is this possible with Flourish? If so, how?

Related

Area map showing the regions where a selected product is the most-popular

I have a set of products with the sales of each product by region. I want to draw a map where the map is filtered for the areas for which the selected product is the most popular option.
I have a data set with two dimensions and one measure. The dimensions are products and geographic zip code. The measure is sales count.
My goal is to draw an area map where the zip codes for which a given selected product is the most popular.
To do this, I can use RANK() which is a table calculation, and set the specific dimensions product (checked, the addressing dimension) and zip (unchecked, the partitioning dimension). But then if the user filters on product, all the rank values collapse to 1, defeating the purpose.
In fact I have read that table calculation and level of detail calculations cannot be combined.
Is there a workaround? Or perhaps I've misunderstood something?

Google Sheets - Cumulatively Add Values in Different Cells

How do you add up values in different cells?
I'm looking to create something similar to: https://i.etsystatic.com/7867478/r/il/09bb36/3897355233/il_1588xN.3897355233_koef.jpg
You will notice in the "expenses summary" box there are different descriptions such as food.
In the lower right corner, there are dropdown boxes for the category. There are multiple categories selected with varying amounts next to it.
Back to the "expenses summary" box there is a column named "actual" which adds up the values in the expenses tracker box.
In this case, this is $55 + $200 + $50 for food albeit in different boxes.
How does one add add these values up in a sheet where the category variable can be changed at anytime?
I have used vlookup to no avail. Fixing the cells would not work due to the variability of it.
There's no way of automatically modifying everything since it's notanother type of databases. The easiest way in my opinion is go to Edit - Find and Replace and Replace All those values. If the Data Validation is linked to a range, then it will be updated too

Tableau: Subset multiple time dependent histograms into multiple rows and columns to fit the screen

I am trying to replicate the plot below (done with ggplot in R) using Tableau:
However, I can't see how I can subset the plot so it fits the screen using Tableau. Using Tableau, this is what I get:
I've attempted adding the following but it stops plotting the histograms and ends up messier:
Row Divider (Discrete):
INT((INDEX()-1)/(ROUND(SQRT(SIZE()))))
Columns Divider (Discrete):
(INDEX()-1)%(ROUND(SQRT(SIZE())))
How can I achieve the plot in R using Tableau?
P.S.: The datasets are different in case you were wondering why Monday doesn't look the same.
You're on the right path using Row-Column divider, but you need to go some step further using the small multiple technique.
For instance, you need to move WEEKDAY in the detail mark and then, use column and row divider in column and row shelf.
Doing so, you'll also need to right-click on CNT/Ride Id Hash) and compute it with WEEKDAY.
Here's a cool guide by a Tableau Zen master showing how to work with this tecnique: https://www.vizwiz.com/2016/03/tableau-tip-tuesday-how-to-create-small.html

Google Sheets: How to make a stacked/aggregate chart

I have made a bar chart which aggregates my data, but is there any way I can split each bar based on the data it is aggregating - similar to how a stacked bar chart would look?
Here is a bad artists impression (thick blue lines mine). The idea is that it's important to know from looking at the graph if I sold 5 at £1, or 1 at £5.
Ideally this would work even if the price for each item is variable, but that is not essential (eg: if there is a 'hack' with hardcoding Apple = 3, I can live with that.)
I'm also fine inputting helper columns etc, within reason, but I would want to be able to easily continue to add things to the list on the left without having to add new helper columns each time (calculated ones are fine, of course.)
Thanks in advance.
UPDATE: With thanks to Kin Siang below, I ended up implementing a slightly modified version of their solution, which I am posting here for completeness.
I added a very large (but finite) number of helper columns to the right, with a formula in each cell which would look for the nth occurrence of the item in the main list (wrapped in an iferror to make the unused cells blank).
=iferror(index(FILTER($A:$B,$A:$A=$D2),E$1,2))
Theoretically it could run out of space one day, but I have made it suitably large that this should not be an issue. It has the advantage over the other solution that I do not need to sort or otherwise manipulate the input range and can continue trickling in data to the main list and have the chart automatically update.
Yes, it is possible to display the chart in your case, however need some data transpose in order to do so, let me show you the example with dataset
Assuming this is your original data:
First sort the data by alphabet, and enter this formula in new column
=if(G39="",1,if(G40=G39,I39+1,if(G40<>G39,1)))
Next add new column for categorical purpose, by using concatenate function
="Price"&I40
In the transform data for chart purpose, enter this formula to split all price into different row, different column for different product
=sumifs($H$40:$H$47,$G$40:$G$47,$A41,$J$40:$J$47,B$40)
After that i select stack bar chart and ensure the price in under series, in case in 23 will have some problem to set price at series correctly, you can use 33 data create stack bar chart and update the data range again, it will work also
Here is the cute chart you expected, accept if help :)
*When certain fruit has less price record, it is advised to fill in 0, as the data table need in same column (see the orange price 3), although I didnot test if blank

Tableau map tooltip not displaying average reference line

I created a chart visualising the cost of living in different cities and entered a line indicating the average. When integrating this sheet into the tooltip of my map, the line is not representing the average anymore but the actual cost of living for each city. I have been trying a lot but can't seem to figure it out. Thankful for any tip!
That's because the tooltip, triggered by the click/hover, is taking into consideration just a city at once, and so the average value is equal to the sum of that specific city: you're running average on just one city.
In order to compute the correct reference value you should create a calculated field like this using LOD:
{ FIXED : SUM([Cost Of Living])} / { FIXED : COUNTD([City])}
Then you could use that calculated field in a dual axis chart.
Doing so, since EXCLUDE acts before dimension filters, you will be able to preserve your average across City even though tooltip will trigger a filter.
Take a look at this simple example made with superstore and keep and eye on the red line (LOD v2) which relates to the calulated field above.
As you can see there's also a blue line which relates to the previous calculated field I wrote (LOD v1):
{ EXCLUDE [State] : AVG( { FIXED [State] : SUM([Sales])})}
Once we move to our main worksheet triggering the viz in tooltip, you'll see that the red value still keep the correct value calculated on all data, while the blue value is taking into consideration just data according to filter.
In fact FIXED is the only LOD calculus which act before the dimension filters and it's able to bypass the filtering triggered by the tooltip.

Resources