Tableau add formula to dashboard action filter? - tableau-api

I've got a workbook I'm building using public data https://public.tableau.com/profile/alee4645#!/vizhome/JSAClaimantsWardtimeseries/Dashboard1
The basics are working as I want, you see the map, you click on one of the coloured areas and a time series chart appears below the map showing the change over time for that area.
I want to add a couple of comparisons to this data, for example I want the time series chart to show a line for the whole coloured area (Somerset) so people can see how one part of it compares to the overall average.
I have the figures as separate rows in the data but of course when the action filter is triggered they get filtered out along with everything else.
If I edit the action filter in the filter shelf for sheet 2, it has the condition tab and I was hoping I could add [ward code] = "E10000027" (the comparison data I want to use) to the formula box so it would also keep the relevant rows of data, but that stops the chart working altogether.
I could achieve it by getting people to choose an area from a parameter drop down but I'd rather let them click on the map so they don't need to know the name of the area they are interested in.
Can this be done?

Related

Tableau | Display different sheets by selecting option(s) from one particular filter

Is there a way to display different sheets by clicking/selecting values/options from one particular filter?
for example, if I have this filter:
and I need to display a sheet named Departments when I select Commercial from the filter shown in the PtrScn.
However, When I click/select any other options like HR, Information ...etc, I want it to display the associated sheet with the filter "Filter by Sector"
Any hints would be highly appreciated!
NOTE: I use tableau 2019.1 and it does not show "Change Parameter" that might be needed to approach this as I noticed when I have been researching for two days now!
You should use a container (say vertical) where you wanna put your N worksheets one on top of the other one without changing vertical spacing: just let Tableau do its stuff!
Be sure to remove the worksheet titles.
Once you're done, you need to create a parameter in order to handle all the N possible choices, and according to that you need to create N Calculated fields with a condition like this one:
if [Param] = 'Profit' then 'ok' else 'ko' end
Each calculated field will be used as a condition (select just ok values) in your filter selection.
Since the parameter can accept just one value a time, you will have just one of your N worksheet displaying data.
And this is the trick based on the vertical conatiner: if you hide worksheet titles, you will see "something" just for the selected worksheet and Tableau automatically will handle all the vertical space in the container.
The result will look like the following:
Adding to Fabio's great answer, these resources about collapsing containers may be useful:
Sheet swapping using collapsing containers
Automatically resize items in a Tableau container (or make disappear in your case)

How can a Tableau Server user change the axis view on a granular table?

I am creating a capacity dashboard that has a granular aspect with multiple rows on the axis. The purpose is so that the user can see the specific view as the fields get more specific, such as Region to Market to Territory. My main problem is if there is a way for a user on Tableau Server to be able to edit the axis (maybe through a filter) so they could basically scale back the granularity a little bit. I know that in Tableau Desktop, you can just remove the dimensions, but I am hoping there is away to do that as a user in Server. Here are some pictures of my
workbook for examples:
You can see that when Territory is removed, it get less specific and shows all of Canada as a whole, grouped together. I am hoping there is a filter view or some way a user could change this dynamically. I have created a parameter with strings that matches the row dimensions that maybe when selected, will show up to that row, but I am not sure how to link that into the dashboard. Here is a picture of that:
Thank you for any help!
The best way to do this is to create a Parameter with your three Axis choices. It should look like this:
Next, create a calculated field that only references the Parameter like this:
Next, you will create three separate sheets. On each one, add the Axis Filter to the Filters Shelf. One each separate page, select one of the three values in your Parameter. (Tip - if the value doesn't show up you can either change the parameter or type it in manually under "Custom value list".)
What this does is create a filter whereby only ONE of the sheets will show up at any time. Meaning if you want to work on the Market sheet select the Market value in the Parameter.
Finally, to bring it all together, you will put these on a dashboard. Create a new Dashboard and add a Horizontal (or Vertical, it doesn't matter) Object (aka layout container) onto the dashboard. Put all three Sheets inside the layout container. You will see only one will be displayed but all three will have headers. On each sheet, click on the header and check "Hide Title" like this:
Finally, click on any downward triangle and show the parameter:
Now, by changing the parameter your user is selecting from three different sheets... effectively letting them change the Axis.
You can also view this documentation on the Tableau Help site.

How to create a pie chart for yes and no answers in Spotfire and not display the Percentage of Yes/No?

I am trying to create a Pie chart as markers in Spotfire map to Show Yes/No answers. How do I do to Display yes and No in pie Sector's instead of Percentage? I am attaching an Excel Spreadsheet with Data with this.
I am expecting to get individual Pie chart for each well in the Spotfire map. For example for WELL_1 Data, the pie chart should have two sectors of two different colors one for YES and one for NO and Sector 1 Should show PRODUCTION, COMPLETION Labels(for yes Category) inside the sector and the Other sector Should show PVT, Image Lables (for no category).
I have tried using the Pie marker option in Spotfire Settings, but not getting the result I am expecting. Any help would be appreciated.
enter image description here.
enter image description here
while Spotfire excels at reading data up and down columns, it's not really designed to read left to right across rows.
you will need to unpivot your table to be tall-and-skinny instead of short-and-wide.
I recommend to start by adding a linked copy of your data table. this way your original table isn't changed, so any visualizations you've already built won't break.
since you haven't specified your Spotfire version, I'll assume you're using 10.x, and my screenshots will reflect that. I'll also be calling your original table Data Table, because I'm lazy and didn't change it in my screenshots ;)
click the + icon in the top left corner
click Other
under "Linked copy to data table in analysis", choose your Data Table
rename the new table to Data Table unpivot to distinguish it, then click OK
from the Data menu, click Transform data...
select Unpivot from the dropdown, then click Insert
configure the transformation
click OK until you get back to the canvas
from the Data menu, click Add calculated column
enter an expression like the following
CASE
WHEN [Category] in ("PRODUCTION", "COMPLETION") THEN "Sector 1"
WHEN [Category] in ("PVT", "IMAGE") THEN "Other"
END
call this column something like Sector
now that you've got the data configured, you can set up the pie chart as needed. here's a sample of that which I put together quickly. I set up the pies on a trellis to illustrate how it might look in your map.

Tableau Desktop Filter Disable/Enable

Working on Tableau desktop[Making a visualization] have two filters one cascaded to another.Need a help when making multiple selections in one filter should disable another filter. If one selection is made in a filter then other filter should be enabled and shown.
Looking for answers
Tableau graph
You could solve this in a dashboard using the sheet/object swapping and popping technique as explained here. Basically how it works is having a dummy sheet which is empty on a certain condition but which will have values if not. The parameter will be placed below this sheet which results in it moving downwards/upwards whenever the condition changes. Together with a motionless opaque text field it becomes possible to hide the filter. I tested the solution underneath.
You will need a calculated field hide_names which results in True if the condition is filled. In your case:
if COUNTD([Manager]) > 1 then False else True end
Next create a dummy worksheet which you will fill with another calculated field which does almost nothing e.g. 'a'. This sheet will be used to 'pop out' the filter in your dashboard. To have this functionality you need to drag the newly created hide_names into filters and filter on the custom value False.
Now let's look at the dashboard.
First bring in the original sheet together with the relevant filters.
Right click the manager filter and select "all using this data source". This way your dummy sheet will also be aware of changes in the filter.
Then create a horizontal floating object in which you need to drag the names filter. On top of the names you need to drag the dummy sheet so if the sheet is active it will push down the second filter.
What you should have now is once you select more than one manager a sheet containing 'a' is shown and the second filter is pushed down. This is not ideal. You will need one or two more things depending on the actual lay-out of your dashboard.
You can make your dummy sheet entirely white by changing the format so all rows/columns/text display white, disabling the tooltip and removing headers and titles.
Create a new empty floating text object. Right click on it and select format text object. Select white shading for this object. This way it becomes opaque. Drag and change dimensions of this object so it hides the second filter whenever the dummy sheet is shown.
Once you have all of these elements you can sort of play with it to make it work. You can find a demo of a dashboard with similar but not exactly the same functionality here.

Tableau Filter from calculated field, but I want to exclude some

I am trying to add to my current calculated field.
It is a fairly simple LEFT(UPPER([STR]),2) that I am currently using. This populates a filter list. However, I want to either modify the formula or the list itself to only include [STR] items where underlying data is and for any that do not have data, they are left off the list until they have data to be selecting.
think of the STR as if it were states abbreviations. IF COUNT([Things]) = 0 then I don't want the state on my filter list, but if there is or if there later gets some Things added in that state I want it to show up.
I tried using IF COUNT([Things]) > 0 THEN LEFT(UPPER([STR]),2) END but that doesn't seem to work. I am also open to just using a condition for showing the filter if that can work, but I am not sure how to set that up.
Strangely I had tried this solution before. I choose Show only relevant values on the filter in the filters box, that made it show nothing at all. However, if you click the drop down arrow on the Show filter card and choose show only relevant values that works.