Sorting a table with multiple dimensions in tableau - tableau-desktop

I have a problem sorting a table on tableau desktop. the table contains only dimensions columns (originally some of the columns were measured and were turned into discrete for the current visualization - I wanted to show them at the end of the right side of the table, and tableau allows to put there only measures and not dimensions).
now I can perform sorting on the first dimension column in the table which is the customer name, but if I want to do another sorting by different columns, tableau allows it only in a nested way which is not very helpful. I want to allow the sorting of the table by the highest income which is somewhat a column that is being located in the middle of the table.
would appreciate greatly your help and answers.

Related

How to combine multiple rows into single column, or multiple columns

How can I take multiple rows of different data for one user, and move them into columns so that each user has only one row.
In my example, I have three tables. The table in red is the current data I have. The tables in green are what I want to convert the data to.
I tried moving each value into its own column with a formula placing a formula in a different column and moving the data over like this: In C2, =IF B2=21, B2' then copying the data into one row and deleting the others. This is long and complicated process and I am wondering if there is a better way.
https://docs.google.com/spreadsheets/d/1utqqw1Am0C_x80t1BiswHmIdWzEhNDHq4vtdBOnkGMI/edit?usp=sharing
You may try:
1st table
=byrow(unique(tocol(A2:A,1)),lambda(z,{z,join(", ",filter(B:B,A:A=z))}))
2nd table
=byrow(unique(tocol(A2:A,1)),lambda(z,{z,torow(filter(B:B,A:A=z))}))

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?

How to assign weights to counts in Google Data Studio?

I have a data set with events and attendees and along with that also the focus area of the events. All events have a focus area 1 and some have multiple focus areas (2&3).
My goal is to have a tree map or pie chart that shows the number of attendees by focus area. If there are multiple areas then I do not want to count the attendees twice but basically assign a weight of 0.5 (when having 2 areas) or 0.33 (when having 3 areas).
Is there a way to accomplish this in Data Studio (can also include some pre-work in Google Sheets)?
The data has to be rearanged in follwing tables:
Event, Area, Topic, Areavisited, Attendance
Event1, 1, Security, 2, 56
This means you need to unpivot your table. It is possbible to do this in data studio with blend. However, no further field can be added to a blend dataset. Therefore, every calculation should be done in Sheets
Here is an example, how to do this with google sheets using pivot.
First generate a Vistfocus =CountA(B2:D2), counting the focus done at each event. Then do a pivot on that table and add as rows, the event/name and each focus-field. Add a summery row for focus2 and focus3. As Values add the attendance and Visitfocus. In H3 insert following formual:
=If(A3<>"",B3,if(A2<>"",C2,if(A1<>"",D1)))
Thus, the values from focus1, focus2 and focus3 are alternating between the rows. Extend this formula over the whole row. And name it Focus
Import this Sheet in Data Studio and filter all null values in ´Focus`.
https://docs.google.com/spreadsheets/d/1J_HxbqW9FGn1FCI8iOOvvz7u4lrs-YsY1V4R7Yg8DBQ/edit?usp=sharing

Moving average in pivot tables in Google Sheets

I'm trying to build a pivot table where one column shows the rolling average of the last 6 cells in another column but I can't get it to work.
Any hints where to start?
Like #pnuts said, don't do it inside a pivot table. In a pivot table, you should not think in terms of rows and columns, but in terms of dimensions and measures. Depending on the current arrangement of dimensions of measures, as well as the filters on the dimensions (visible or invisible), the moving average could show very wrong results.
Instead, construct your moving average as a column associated with the pivot source range.
If you must do it from inside a pivot table, you can try using the GETPIVOTDATA() function, but I predict the exact expression could get very convoluted.

Highcharts: stacked column with grouped categories

I'm trying to do a chart with stacked columns but for each column having different entries. I will explain myself better.
I would like to use the demo of Highcharts:
http://www.highcharts.com/demo/column-stacked
But:
In the demo, the series are always the same: John, Jane and Joe. What I need, is to have different series for each column (xAxis category). I tried the plugin "https://raw.github.com/blacklabel/grouped_categories. This is fine to have multiple series grouped, but the grouped series are split into multiple columns: I need just one stacked column for each multiple series.
For example:
I want to group the population living in the west coast: I need a stacked column with the data from CA, WA and so on, And the column should clearly show every state, one on the top of the other. Then, in another column I want to group the population of the east coast, grouping in one column FL, NY and so on.
Can someone please help me?
Many thanks
Vignus

Resources