Using Parameter Actions to Choose a Chart Type

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this week's tablet tip tuesday i'm going to show you how to use icons to pick a chart type if we look at the example on the screen now you'll see that i'm showing a bar chart if i click the line chart icon i see a line chart if i click the map icon i see a map and i could go back to the bar chart so how do we go ahead and build that so first thing i've done is i've gone ahead and built the three sheets that we need the line chart the part chart and the map what we want to do now is we want to go ahead and create a parameter that allows the user to pick the option for the chart so i'm going to just call this chart type and i'm going to make it a string and i'm just going to hit list and i'm going to choose bar line and map and let's go ahead and hit ok i meant to put this bar chart over there and let's show that parameter you can see right now it says bar so what i want to do is i only want to show this particular chart when they pick bar from the parameter so i need to create a calculated field that just returns chart type selected and i'm just going to bring in all it's going to return is the value of my parameter if i drag that to the filter shelf it now says bar great if i switch it to line it now goes blank switch at the map and it goes blank make it a bar again and it goes back to a bar so let me switch it to line and i'm going to go over to my line chart and repeat that process so now the field the calculated field says line and if i switch it to map my line will go blank as well and now i can bring map in here okay very good so now we have our nice simple worksheet let's go ahead and throw this in a dashboard real quick i'm going to bring in a vertical container and show my dashboard title let me put that inside of the container and i want to bring in a horizontal container that's going to hold let me go back two steps let me bring in a horizontal container that's going to hold the three charts so let's bring the bar chart in let's bring the line to mean to float let's bring the line chart next to it and let's bring the map next to that and i just kind of go ahead and kill my color legend and we have our parameter here which is fine for now i'm just going to float that just get it out of the way all right there we go so i'm going to go ahead and hide the titles for these three charts and what that does is it forces tableau will automatically reduce the size of the chart or of the of the blank chart so if i pick a bar now switch is a bar chart then line chart and then map i think it looks pretty cool when we have animations turned on here so i'm going to go ahead and do that and let's set it to maybe a half a second so let's see how it looks now so it brings in our bar chart brings in our line chart maybe i should make it a bit faster i just like the animations okay there we go okay great so now what we need to do if i go back to the example is we need to have these three buttons so you notice maybe it's one sheet so i'm going to create a new sheet and i'm going to call this select chart type and that's going to give me that for the title which is really nice and i'm going to create three calculated fields i'm going to call this bar and it's just going to have the word bar in it i'm going to create another one called line and that's just going to have line in it and these are matching the values that are in my parameter to create one more call it map and that's just going to pass the string map hit ok and there we go so now i'm going to create three calculated calculations inside of each field so i'm going to do the average of zero the average of 0.0 and the average of 0.00 now i need to add decimals so that tableau thinks they're all separate fields and i change the mark type to a shape okay and now on this first shelf i'm going to go ahead and drag bar to the to the shape on the second shelf i'm going to put line on the shape and on the third shelf i'm going to put map on the shape okay so my bar chart what i've done is i've i've gone to flat icon and downloaded three different icons make sure you give credit to those so you'll see in my in my version here i've given credit to where those icons came from so in my bar chart okay let me go here in my shape i'm going to go ahead and go down to my my charts and i'm going to assign that a bar chart all right i'm now going to go to my line and assign that a line chart and then the third one will be a map so let me just go ahead again last time and pick a map there we go all right so that looks pretty good i'm going to go ahead and do a bit of cleanup i'm going to hide the headers i'm going to format it and get rid of the grid lines i'm going to get rid of the zero lines and i'm going to get rid of the row and column dividers and i'm probably going to need them all bigger so i'm just going to go to the all marks card and maybe make them a bit bigger something like that all right great so now what i want to do is i'm going to go to my dashboard and i'm going to drag in this new sheet up above this one so just stick it in there somewhere and i can go ahead and kill this container i don't need that anymore oh one thing i forgot to do on this sheet was to remove my tooltips i don't care for the tooltips there so now they don't say anything when i hover over okay so i'm going to make this sheet a bit bigger so we can see the icons in full set it to entire view all right we're moving somewhere now okay so now what we need to do is let me go ahead and kill the dashboard title what we need to do now is we want to go ahead and set up our parameter actions so let's go up to dashboard actions and i'm going to add a change parameter action and i'm going to say bar chart and what i want to do is the source sheet is going to be my chart type and the target parameter is chart type and i'm going to pass to that bar i'm going to add another action and i'm going to tell this one line chart and set it up the same way chart type and line and then lastly one more for the map target parameters chart type and the field i'm going to pass is map okay so now if you watch keep an eye on my parameter here when i click on it it'll switch to line when i click on the bar chart it switches to the bar when i click on the map it switches to the map it's pretty magical so i'm going to go ahead and hide my parameter because i know it works now now the last thing i want to do is i i don't like it how this icon gets gets highlighted i just wanted to kind of show them all again so i'm going to go back to my chart type field and i'm going to create a dummy calculated field i'm just going to call it dummy and put that onto the detail shelf now in my dashboard i need to create another dashboard action and this one's going to be a filter action and i'm going to call this update dummy and my sheet is going to be my let's see it's going to be my select chart type the target sheet is my select chart type i want to do it on select show all values and then in my filters this is the trick so i want to set this up i want dummy to filter segment or any other field it doesn't really matter hit okay hit okay again and now you can see when i switch to the bars these things are no longer highlighted okay so that's the tip for this week you obviously could expand that out to a lot more chart types if you wanted to the big things there were putting all of the sheets in one container and hiding the titles so that forces them all to use up the maximum space and then we created the chart that has the three individual icons on it and you click on one of those and it and it changes the view so hopefully you got a lot out of that and if leave some comments if you have any questions and have a good day
Info
Channel: Andy Kriebel
Views: 15,353
Rating: 4.992126 out of 5
Keywords: tableau, tip, parameter, parameter action, icons, chart type, actions, dashboard actions, filter action, trick, deselect, buttons, containers
Id: yEApDIou2hg
Channel Id: undefined
Length: 9min 5sec (545 seconds)
Published: Tue Jul 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.