How to display filtered data rows as a tooltip in Tableau Public? - data-visualization

Noob here, I have a table with different entries (rows) per different (repeating) regions.
I'd like to be able to display the data rows filtered - matching that particular region thanks - so I get those particular fields related to each region as a tooltip on a map. (I know how to build the map)
Thank you

Just dragging the fields you want to Details or Tooltip is not doing the trick?
Putting a measure on a shelf (other than filter shelf) includes that field in the visualization query results -- i.e. applies the chosen aggregation function to yield an aggregate result value for each partition of the data (as specified by the unique combination of dimensions)
Putting a dimension on a shelf (other than the filter shelf) also includes that field in the query results, but since the dimensions define how data rows are partitioned, it can affect the level of detail of the query. You'll notice this often as suddenly getting many more marks in your visualization after you add a dimension to a shelf. If you are familiar with SQL, dimensions define the fields that follow the GROUP BY keyword.
EDIT
Thanks for the addition, #AlexBlakemore. I've never said dragging a dimension would not work, only that it wouldn't work as the OP wanted it to (basically the same as you're saying).
And though everything you said (above) is true, it's particularly not exact when it comes to maps. Yes, dragging a dimension will further partition the data, but it will not create additional marks on a map (unless it has also geographical properties). Rather, the tooltip will get the first occurrence of that dimension, and display data for that only. For instance, if you drag "Product" to details, and the possible values are "Bread", "Coffee" and "Milk", it will probably just show "Product: Bread", and the measures for "Bread" only. So yes, it will partition, but no, it won't create additional marks.
Back to OP problem. What I believe you want is a tool tip with all values of the dimension (in my poor example you'd like to see "Bread, Coffee, Milk"). Tableau does not have functions to aggregate strings yet, so it's hard to do so.
What I would suggest is to create a separate sheet, and just drag the dimensions and measures you want to rows. Then put it side by side with the map on a dashboard, and use the map as a filter. Then, when you click on a country/region/city, you'll see the data of that region on the other chart.
Refer to: http://kb.tableausoftware.com/articles/knowledgebase/creating-filter-actions-dashboards
or https://www.tableausoftware.com/learn/tutorials/on-demand/authoring-interactivity

Related

Dynamic measure that responds to dynamic dimension

I'll try to describe this scenario without introducing too much irrelevant info, but keeping it simple.
Using the newish Field Parameter feature in PowerBI, I created a Parameter called _Dimensions and another one called _Measures, selecting common columns in the former and common measures in the latter.
I then build a bar chart with [_Dimension Fields] for X-Axis, [_Measure Fields] for Y-axis, and a single-select slicer for each. Now when user selects a measure and a column, it draws a bar chart of their selected measure, sliced by their selected dimension.
What I'd like to do is actually make this a Pareto chart, which would entail putting in a second measure on Y-axis, but rather than having a pareto counterpart to every possible measure a user may select, I'd like to create a single measure that calculates running percent of total of [selected measure] along [selected dimension].
I was hopeful I could call the [_Dimension Fields] column that PowerBI created with its special properties from DAX, but that doesn't seem to treat them any different than any other column. I also tried NAMEOF, but that just returns a string. I was hoping it would act like INDIRECT does in Excel, treating the string as a reference, but alas.
Does the above problem statement make sense? Can anyone describe an elegant design approach to do this dynamically that does not involve just writing a version of every possible measure a user could select and then use a switch?
imagining the combo chart to look like this (pareto measure in line chart part)
edit: secondary question, but equally important to the end goal of a fully functional dynamic pareto: when user selects measure, I want the selected dimension to always be sorted desc by selected measure. This is how you do a pareto analysis, but PBI does not default to sort descending always, and each time you change the dimension (via slicer click) the chart resets sorting. Any way to ensure that the sort order is fixed correctly?
Calculation groups are the way to go and Tabular Editor is used to create these.
After much exploration, here is my solution. It's not 100% dynamic in that it requires writing custom DAX for each dimension and measure that you need to be available for dynamic use, but gets the job done for the scope of the report in question.
create field parameter from columns that I will want to dynamically use in viz: name it _Dimension
In my example, I will be using two columns from two tables: Carrier[CarrierNumber] and ShipmentLane[LaneCity]
create field parameter from measures that I will want to dynamically use in viz: name it _Measure
in my example, I have two measures I will want to be able to toggle between: Events_Late and Events_Late2. Both exist on OnTimePerformanceDetail table.
create measure to dynamically return value based on the selection of
_Measure in slicer on canvas. This seems like it should not be unnecessary with field parameter feature, but it is necessary for reasons that will be
clear if you try to do this without a custom measure.
create a pareto measure for each of the dimensions that may be
dynamically passed to viz. Each of these dynamically evaluates the base measure, but is specific to a single column for which the measure evaluates over:
create a dynamic pareto measure that chooses the correct pareto calculation based on the selection on _Dimension
create single select Slicers for _Dimension and _Measure
create combo chart, using _Dimension for X-axis, _Measure for Y-axis, and DynamicPareto for line Y-Axis. I have aliased DynamicPareto on the viz to Running% so that it shows nicely and clearly on legend
set the sort order of the chart to be ASC by Dynamic Pareto measure. This ensures that the dimension on X-axis is always sorted correctly
A few notes:
I named the dynamic pareto as "Discrete" because this only works as
designed when doing pareto on a discrete dimension, where the bars
are meant to be sorted desc by [measure]. If you are doing a
Percentile chart, which is basically the same thing, but the
dimension is sorted by dimension value instead of measure value, the
Pareto calculation needs to work slightly differently.
There are lots of Pareto measure patterns out there. I used the one
from this blog, because it's concise and performs well:
https://janizajcbi.com/2018/08/22/pareto-rule-abc-class-in-dax/
it is important that the slicers be set to single select
I discovered there is a Pareto 3rd party viz that is simple and
dynamic, but has very limited formatting features. Fine for quick
analysis, but if you have branding or formatting standards, it may
prove unusable, as in my case
in my production use case, I have a lot more dimensions and a lot
more measures that will be available. Started with just 2+2 to prove
out functionality. Just need to follow same pattern to add more
available dimensions and measures to mix.
my naming convention of * suffix is because this report is built on a
centralized data model. The * makes it easy to find measures that are
local to this report and not a base measure in the model I am
connected to.
the field parameter feature can only be used with a remote model like this if the preview feature of Use Direct Query for AAS and PBI datasets is enabled OR the field parameters are added to the base model. In my case, I'm adding the field parameters to the base model, and all of the measures here are local to the report, connected to remote model.

Tableau: Self-Organizing Map visualization

So, it's my first time trying to make my own data visualization, and what I want to do is something like a heat map or highlighted table like the original Kohonen (but using squares rather than hexagons) research about countries, but I don't know how to apply it to the map I've got from training the network.
I've read a few links about making a highlighted table and heat map on Tableau, but what I get is always just a table mainly because I'm not using a measure (i just want every country of one color), so, my question is: is it possible to use Tableau for this situation and if so, how could I do it? Thanks!
Original SOM visualization from Dr. Kohonen
Table from Tableau
Yes it is possible to make visualizations like you describe in Tableau - but the question you posed is a bit vaguely specified to give you much more detailed guidance than first take some Tableau training.
For instance, how do you want to determine which row and column to place a country? You may need to write a table calc for row and col positions, which means learning about table calcs. Or you can assign them in a data column.
For square country marks, you'll want a discrete field on the rows shelf, a discrete field on the columns shelf, possible a dimension like Country name on the details shelf. Choose a square mark type, and (important) choose a square cell size from the format menu. Then adjust the size of your squares from the size button and the format menu, and colors and borders from the color button and format pane.
Lots to play with.

Dynamically creating a pivot table using fuzzy matching

So, I'm constantly being given data in new and different formats. I'm on a crusade to get my work to standardize data for easy use, and if I managed to convince the powers that be to standardize data, this problem becomes entirely moot. Until then, I have the following problem:
I get data in a variety of ways. Sometimes my gross sales are called total sales. Sometimes gross sales before discounts, total sales before discounts, Gross_Sales, etc. Discounts, deductions, exempt amounts, etc. form another column. So on and so forth. I'd like to be able to do the following:
1) Figure out what columns I want,
2) Turn those columns into a pivot table.
For part 1, I have two options, and I'm wondering if there's anymore: The 1st is to use Microsoft's fuzzy-matching add-in to help me match. I'd have a separate tab dedicated to fuzzy matching each column I need. The second is to just generate a long list of all the variants, and to test each one until I find a hit, assign it, and move onto testing the next one.
The second part is turning all of this into a pivot table - the resouces I have so far are https://www.thespreadsheetguru.com/blog/2014/9/27/vba-guide-excel-pivot-tables and How to Create a Pivot Table in VBA
Is there a better method? Is there another way?
Edit: Slightly better method - Grab the data columns, place them into a table, and pivot everything off of that table - it removes the need to re-create pivot tables, just need to move the data over.
Having the same problem, I use a mix of your two methods.
My data consists of a bunch of logs for rejected x-ray images, and the reject reason is a free text field. My solution was to create a table where the first column contains my desired output categories, and then each subsequent column contains a different variation of it.
For example, a row might have (column one/ouput first entry):
Positioning, POS, Positioning Error, Patient Positioning
Note that these are all fairly different from each other. Where the fuzzy matching comes in - it is used to capture all the smaller differences and mispellings around those other columns. When the fuzzy matching section decides a given reason matches a column's entry, it is then replaced with the appropriate desired output reason from column 1 of the table. In my example, a reason of 'Possitioning Err' [sic] would match to column 3 (Positioning Error) and then get converted to Positioning.
Then wash rinse repeat over the rest of your data as needed. This approach was super useful and fairly flexible in helping standardize my data. It was also computationally more expensive, but you'd only need to run the matching portion once I guess.
As for the actual mechanics of going about doing this - I use 2010, so no inbuilt functionality. I run the fuzzy matching code on a temporary worksheet until best percentage matches are found, and then overwrite the actual source data afterwards.

Make Spotfire ignore empty values in the categories of charts and show a visualization without "spaces" between the bars

I have a group of trellis graphs on some data, in there you can see a numeric variable on the Y axis and a series of cell dishes on the X axis. Not all the numeric values are present on all the series of cells. Because of this the visualization results in a graph with empty spaces:
This is OK most of the time but the thing is I would like to avoid the "empty spaces, only in these graph series, that you can see between the bars. I would like to see showing only the pattern of the cell dishes where I have data.
Trying to do so I tried creating a calculated column to use it as a ordering index (https://docs.tibco.com/pub/sfire-bauthor/7.9.0/doc/html/en-US/GUID-8CAA18D0-CF28-4707-9945-041BDFD99E99.html) (Sorting Filter values asc/desc on Tibco Spotfire), after that "Limit data by expression" using a "[MyColumn] is not null" on it (https://community.tibco.com/questions/can-i-automatically-make-spotfire-ignore-empty-values-categories-charts) (How to show the top 10 column values in Spotfire) with no luck and I tried also (https://docs.tibco.com/pub/spotfire/6.5.1/doc/html/ncfe/ncfe_details_on_custom_expression.htm) create a custom expression, which I think it would be a good solution because I understand it will only affect these graphs and not the complete set of visualizations but no, I don't reach the point to change it. Last that it should work but it doesn't is to "Show/Hide Items" under a Boolean expression that it would include that "[Axis.Value] is not NULL" and "Apply individually for each trellis panel" of the numeric column which sound terrific but... nope, it didn't work either...
Any help would be appreciated, now I will select one by one on individual graphs extracting them and plotting them in other place but this is not very useful as a "large scale" solution. I am sure there is a way to insert a proper expression to avoid the null values of the cross of both variables, the numeric and the cell dishes.
this is because you are trellising data, not the axis. you won't be able to filter out values on the x axis; it's simply not how trellis works.
using multiple visualizations is the solution, but I assume you've got n sets of categories that you want to separate out without creating a ton of charts on the page and perhaps you can't guarantee the number of categories or their names, so you want to build a flexible solution.
please check out an answer I just wrote over here which illustrates how to use a document property and a property control to limit a visualization. your property control can be linked to automatically and dynamically display unique values in your "category" column (the one you are trellising by). maybe this can be a solution for you?

Best way to handle multi-valued fields as a view/grid

In several notes applications, instead of handling related data as separate documents, if the size of the data is small (less than the 32k limit), I'll make several multi valued fields and display it in what I call a "List Panel". It's a table where each column displays one multi-value field. Since fielda(1) goes with fieldb(1) that goes with fieldc(1) there is a concept of rows. (I did a similar thing in my auditing routine discussed here )
It is always assumed that each field has exactly the same number of elements.
All the multi-value fields are then stored on the single document. This avoids several coding conventions that made my eyes bleed like having date changed, who changed it, new value fields for each field we wanted to audit. Another thing that this kept to a minimum was having to provide multiple fields for the same thing that locked you into a limit. Taxrate1, Taxrate2, Taxrate3, etc...
In my "Listpanel" the first column is a vertical checkbox. (One for each element in my lists) This is so I can select one item to bring up and edit, or select multiple values to delete "rows" or apply some kind of mass change to them.
What would be the best way to handle this under xPages to get this functionality? I tried making a table but am having the devil of a time to get the checkboxes to line up with their corresponding data items.
Views and dojo-grids seem to assume we're using a document for each row.....
This TableWalker may provide what you want http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
It was created when XPages was all very new, so it's SSJS rather than Java. But if you're comfortable wiith Java, converting it probably won't be a challenge.
You could use a repeat control to display the values and build a table using the table row tags in the repeat. You would want to calculate the id of the checkbox to be able to take an action on that selected row. The repeat var would be just one of your multi-value fields and you use the index of the repeat to get the value for that row from the other multi-value fields.