12 Use Cases for Parameters in Tableau

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so what we're going to talk today about is parameters and you guys have said that you have used them before but not necessarily in the hole a hole fit of anger so I've created twelve examples for you guys and hopefully we'll get through as many of these as we can in about 50 minutes and if you have any other questions afterwards we can always run more sessions or things like that so to start let's let's get an understanding what parameters are again these are basically parameters are ways that you can give users control over the visualization so instead of you know having constant values for visualization you can then let your user decide what they want to see or interact with or things like that so some examples of parameters might be user controlled thresholds you can allow them to do what if analysis so forecasting projections would be an example of that dynamic fields axis titles etc and we'll go through an example event filtering across different data sources top end analysis so in other words you're allowing the user to specify how many they want to see in the top end analysis and there's two steps to creating a parameter first you have to create the parameter and the second thing is you have to either use the parameter in a calculated field a reference line a set or a filter so just creating a parameter doesn't do anything you actually have to use it tell tableau how to actually use it so I'm going to flip over to tableau now and the first example I want to walk you through is a dynamic reference line oops let me go ahead and clear my screen here and I'm gonna delete all of my parameters yes should have done that ahead of time okay so the first thing that I want to do is delete all of these fields because I didn't prepare my workbook like I thought I did yes okay so the first thing I want to do is let's say that we want to look at sales by day so I'm just going to right click and drag order date to the columns shelf and that brings up a little context menu and I want to look at continuous dates so I'm going to go down here and pick my Green Day field I hit ok and then I'm going to just drag sales to the rose and we get this really interesting you know not very useful line chart but let's say that our organization went through a change and maybe on I'm on a particular date or or maybe it's a user-defined date we want to be able to divide up the visualization so to do that I'm going to create ok create a parameter so I go up to the little triangle next to dimensions and choose create parameter and I'm going to call this just pick a date very very simple like and then the parameter section is broken into a few parts you have first you have to pick the data type so you have examples of float in your strings boolean States and date and time for our example we're going to look at just a date and you'll notice it defaults to the current day so I'm going to just go ahead and change that for now let's just say 2012 and yes you can just type in there like that and let's just say we want to pick January 1st of 2012 just as our starting default date you can change the display format if you want but for now we'll leave it for automatic and you also notice that we get this section for allowable values we can either allow the user to input anything we could give them a list or we could give them a range for now I'm just going to go ahead and choose all and hit OK and down here on the bottom left hand side we now have this this parameter called pick a date so I'm going to right click on that parameter and show it and what you'll notice now is that we have a parameter up here and if I change the date so let me switch again on white didn't say stick with our default date there that's kind of strange so let's just pick January 1st 2012 you'll see nothing actually happened if I flip back over to my powerpoint step 2 is we have to either use this in a print we have to use the parameter either a calculation reference line asset or a filter okay so let's go ahead and see if we can do it on a reference line so I'm going to go over to my analytics pane and I'm going to drag on a reference line and I want to do it for my just the table for my day of order date and one of the things you'll notice now is in my drop-down list you'll see I have my list of parameters so I now have my parameter called pick a day and for my label I'm just going to set that to none and maybe just make it like a dashed black line something like that and now we've got the visualization split up by this line so if I change the date let's say to February 9th you'll see that this moves over so this is just a great way for your users to maybe identify us a significant date or something like that in the visualization so we can then extend that so we could uh let me go ahead and and put the reference line on this view as well and the next thing we might want to do then is maybe we want to let's just pick something in the middle here let's say that we want to it looks like that broke it doesn't okay so let me delete this sheet or clear this sheet and I'm going to go back over here and duplicate this one okay so now what I want to do is I want to take this visualization and I want to split it up by two colors so in other words anything that's to the left of the vision to the left of the reference line I want to have this one color and anything this to the right of the reference line I want to have as a different color so again you might want to do this just to make it more clear on where the split is so to do that so again we have our parameter but this time we need to create a calculation with that parameter so I'm going to do create calculated field and I'm going to say is I'm just going to name it is older than date chosen something like that and this is going to be a very simple calculation so I'm going to say is is my pick a date less than or equal to my order date and this is going to result in a boolean calculation so you'll see here I've got this is date is old is older than date is has a little true/false next to it which means it's a boolean calculation and all this is doing is she's checking yes or no is it above or below that line so I can drag them to the color shelf and now you can see my visualization is split up into two parts nice and neat so if I change my date again maybe back to December 6 for some reason you'll see that the color moves along with it December 5th whatever whatever you want to choose okay so that's the second example a reference date with the calculation so let me delete that sheet all right so the next example we might want to look at is maybe a sales forecast so let me do a new sheet and an example here might be let's say that we have products subcategories and we have sales and we want to have a second measure that allows us to specify a forecast so I could do that with a parameter so again I'm going to go up here to the triangle next to dimensions click on that and choose create parameter and I'm going to call this my sales forecast now a sales forecast is usually in percentage format so I'm going to leave this as floating and then maybe for this example we want our display format to be maybe zero decimals four percentage is something like that okay and we could give our users a range maybe we want them to go from minus one to one so that in other words from Mendut negative 100 percent to 100 percent and what this step size option does is this allows the user to click through the percentages so let's say that we only want them to be able to choose every five percent so I'll particularly tick tick on step size and type in point zero five hit OK and now we have a new parameter called sales forecast so let's show that parameter and you'll see I now because I chose that step size you'll see that my sales forecast now I can click on these arrows or I can just drag this so how can we use that then well that's the again the second step is to use it either in a calculation a reference line a set and let's go ahead and create a calculated field and let's call this our sales or caste and all we want to do here is we want to take our sum of sales and multiply that by one plus the sales forecast now we have to do one plus the sales forecast because if I choose 25% for my sales forecast I wanted to go up by a hundred and twenty-five percent not if I multiply it by twenty-five percent then that would actually reduce it so I'm going to hit okay and now I can take sales forecast and drag that on to my sales axis to get a shared axis view and you'll notice that I now have two different measures I'm going to go ahead and put measure names on color to make them a little more clear so you can see that our sales forecast bar is 25% higher than our sales bar so we could slide that over and you'll see that they continue to grow or shrink based on the value that we pick for our sales forecast so let me go ahead and delete this sheet okay so the next thing we might want to do is maybe we want to combine our our previous view that has our reference date with our calculation with our sales forecast so let's go ahead and create another new worksheet and we'll start from scratch let's take order date and drag that to the rows and let's just say one do it by day and then let's take sales and drag that to the rows and let's just make it just for to make it visually a little bit nicer let's just make it a running total calculation so we have something like that now we're going to go ahead and show our parameter control for our date and then show our parameter control for our sales forecast and let's throw our reference line on there again so I'm going to drag my reference line on make it the minimum of my pick a date I'm not going to bother showing the value make it a nice black line okay so now what I want to do is I want to have a second line that when it hits this reference line it starts to use the forecast so in other words I might say that as of September the 14th of 2011 I'm projecting a 20 percent sales increase so my I should have a second line that branches off right here and goes starts going up by 25% so to build that we need to create another calculation so we want to call this one sale I'll call this one sales projection because we already use the name sales forecast and what I want to say here is I want to say if my pick a date is less than or equal to my order date then just give me the sum of sales otherwise give me the sum of sales times one plus the sales forecast I think this is yet there we go and so what this is saying is if my date is older than my if my pick a date is older than my order date give me the sum of sales otherwise give me the sum of sales times the parameter and it looks like I did something wrong so I'm trying to mix aggregate not agree it okay so I need to so I need to get rid of my sums here so now that should be okay and we hit okay and now we have a new field called sales projection down here onto our measure value shelf and also change this one to a running total and we could see that I did something wrong so let's let's look at this again so let's look at our sales projection and we want to say if our sales is that then do something else okay so I messed up the calculation somehow so this is when you open up a previous workbook and you double check to make sure you did it right so bear with me for a second I'm going to pull it up in tableau 10 I did something wrong with the calculation all right so if I go to my sales forecast here profit the trend so our calculation should look something like if order date is less than represent profit and it's exactly what I did okay so um and how are we doing this table calculation okay so I think it looks like I did do it right all right so does anybody see anything that looks wrong here anyone I think I'm doing it right all right so it looks like okay so some they left the comment here ordered eight less than picked eight oh maybe I okay thanks Tim so let me do in here to my sales projection and I'm saying if oh I've got this backwards thank you so let me change this to order date is less than or equal to pick a date okay there we go all right there we go so now you can see we actually have two lines on here you can see the red one is just behind the blue one but once they get to the reference line they start to diverge so now it goes up 25% something like that or 55% or maybe we're projecting a sales decrease so this is just a nice neat way to use both the reference line parameter and a sales forecast to make a dynamic view for your users so I can switch it to the fifth of January 2012 and you'll see the same thing applies so that's a neat little neat little option there so let me delete that sheet let's call this one our sales trend okay so the next one I want to show you is a way to do dynamic sorting so the first thing I want to do here is let's just put the put product subcategory in the rows will put sales in the columns will put profit in the columns and we'll put average discount in the columns so notice at that time I right clicked and dragged discount to the rows pick average now what I want to do here is I want my users to be able to decide which one of these things they sort by so maybe I want to sort by sales or profit or discount so to do that I'm going to create an another parameter oops not calculated field I want to create a parameter and we'll say I'll just call this one sort by in this case we're going to do a string parameter we're going to choose a list and I'm going to give them three options sales profit or discount and those are obviously go with the names in the column I'm going to hit OK right click on my parameter and show it and I get a nice little drop-down but you notice that this doesn't actually do anything because we haven't created a calculation to use it yet so I'm going to click on my triangle critic creative parameter I'm sorry not create a partner I want to create a calculated field I'm going to call this sort order and this time what I want to do is I'm going to use a case thing I'm going to say case and then I could just drag my parameter into into the calculation when they pick sales then I want to do sum of sales when they choose profit then I want to do some profit and then I could just do else average discount it okay hit OK and now we have a new field called sort order and if I put that in the view I don't have to put it in to do but I just want to show you how this works so when you see now I have profit chosen so it matches exactly to my profit bar and if I pick discount it's going to switch and match my discount if I pick sales it's going to match my sales okay great so what I want to do now is I want to sort my my product subcategories in descending order by my new field so I called this one sort order and hit OK and now I've given my users the option to dynamically sort the view so now it's sort of by discount or profit or sales very good ok so now another way you can extend this though is let's say for example that you want the you want profit and sales to be sorted in descending order like they are but you want average discount to be sorted in us getting order so when they pick discount you wanted to actually go in the opposite order well that's a pretty easy fix I can just come in here to my sedet my sort order field and just pick a negative in front of average discount what that's going to do is it's actually still going to sort in descending order but because I'm putting a negative my most my least negative will be first so now you can see profit will go and sales will both go in descending order and it gives the user the appearance that average discount is in ascending order so that's a neat little trick ok now maybe we want to combine this view so let's go ahead and let me add the sort here and let's do descending by sort order okay and this time we have our product names and it looks like this is a slider let's go ahead and switch this to a drop compact list or you know you do notice you do have these options similar to filters where you can you know just give the user some different the different look and feel to the parameters depending on the type that you like okay so what I'm going to do now is I'm going to go ahead and let's say that we only want to look at the top the top n based on the the parameter or the metric that was chosen so to do that I'm going to go to my product name and choose filter and I'm going to choose use all here and over on my top I'm going to do by field and in within the parameter so this shouldn't be technician 1 this should be by sort order we can click on this drop-down and choose create a new parameter and create a parameter directly from here and what you'll notice is tableau automatically defaults this to an integer datatype so and it builds out a lot of the view for us so let's say this is let's just call this our top pin and you'll see it defaults to 10 and the great thing about doing it this way is you can template we actually fills out most of it for you so in this case because we don't have step size check the user we just type in a number maybe we want the minimum value to be maybe the most the least they could show would be 5 and the most they could show would be maybe a hundred that's fine and we'll just say ok hit OK again and watch over here on the right-hand side because magically our parameter will start to appear all right and you'll notice our product name is now on the filter shelf and I can just slide this over and it lets the user kind of pick whatever they want so this in this case we're looking at the top 18 by profit and it looks like my pills cuts my order got switched around there we go I can switch this to sales and you should now see the top 18 by sales and or top and I know it's the I know it's the right number of records because if I look down here on my on my status bar down here on the bottom left you'll see it says 19 rows that matches with the number that's in my parameter ok so you'll notice here that global troy executive leather low back tilter is number 1 if i switch this to discount you'll see that I have a few they get no discount so that one is now gone so you can see that both our our we have the top end acting as a filter and that's also using it based on our sort by that we had chosen earlier ok so that covers the first few let me go through and see which one I have up here next we got dynamic sorting top and in sort ok so the next one I want to take you through is a dynamic dimension so in this case let's say that we just let's put sales on our columns and maybe we want the user to be able to do something similar to similar to this where they take product subcategory and they say you know what I don't want product subcategory I want product container or they want maybe order priority basically we want the user to be able to select the field that is in the rows so to do that we're going to create a parameter and I'm just going to call this one select a dimension in this case we're going to make it a string make it a list and we'll just enter some of the dimensions that we have in our view so let's say let's say we want customer name and we want product sub category and maybe we want to use State something like that let's just do three for now and now we have a new field a new parameter called selective dimension and again it's not doing anything because we haven't told tableau what to do with it we only did step one so what we need to do now is we need to create a calculated field that basically pulls back the correct dimension based on the one they select so I'm just going to call this one dimension selected and again I'm going to use a case statement you can use an if statement as well and I'm going to say when I'm going to do case select a dimension when they pick customer name then customer name when product subcategory then product subcategory else oops state and I always have to close your case statement and now we have a new dimension called dimension selected I can drag that into the view and now um you'll notice as I pick my dimension from my parameter my list changes and I could then sort this I could sort this by my sales field for example and I could also use this in conjunction with my top or bottom filter if I want if my you know my top end parameter so lots of lots of ways that you can you can expand this so we'll call this as a dynamic dimension okay and the next one we want to do is we want to do a dynamic dimension and a dynamic measure okay so we already created this one measure called sort by right we have this parameter called sort by maybe we want this to actually be reflected in our columns so let me go ahead and close that high back and let me do placate this sheet and let's go ahead and show my sort by parameter okay so what we can do now is we do have a field that is returning the value for our sort by if you remember we created this one called sort order issue if this one is that this average discount has a negative in front of it so we don't want to use that same we need to fix that so I'm just going to duplicate my sort order edit that and let's just call this one measure selected and I'm just going to remove the negative in front of discount okay so now I can take measure select it and put that in the columns and you'll notice that my based on my parameter now it'll swap out the metric that's in the view okay fantastic so what we can do now is we could sort we can choose to maybe to sort this instead of buy sales we could sort it by even our sort order our previous field that we created so now when they choose discount you'll see that I get all of my negatives first or I'm sorry all of my no discount customers first or if I pick profit I get my most profitable customers first I could even then maybe incorporate my parameter for my top end so we can now filter our dimension selected by our parameter it okay and maybe we want to just do the top ten I can get there just right there we go to top ten based on profit or my top ten based on discount or based on sales something that okay it looks like we've got a question all right no worries Tim thank you for coming all right so this is a dynamic measure dimension and measure now one of the neat things we could do now is what I don't like about this particular view is that our axis says measure selected so we can create a calculation that just returns the value of the parameter so in other words I'd like this to say sales for example here instead of so if I drag my sort by you can see it says sales here so now I can just hide my field labels and then just remove my title I can't put the parameter in the title unfortunately the title of the axis so we'll just leave it like that but notice what happens now when I switch it to profit I get a nice little it changes nice and neat that I like so and then we could maybe hide the field labels for the rows so it does you can reuse the parameters in the rows and columns as well okay next one okay so this is a pretty fun one this one we want to create a dynamic view the idea here is to create is based on the dimension that they pick we want to either draw a bar chart or a map alright so how would we do something like that so let's start by let's just create a new worksheet let's show our selected dimension parameter and let's go ahead and put our to mention selected in the rows and let's just sue sales just to make it a simple example and maybe we'll just always sort our dimensions selected in descending order by sales okay so now you can see if they picked product or customer name I want to show up our chart but if they choose state I'd like this to flip to a map okay so what I could do is I can create a I'm gonna crew I'm just going to simply drag my I think I can drag my selected dimension nope I need to go ahead and take where is it dimension selected drag that to the filters no that's not right we want to create a calculated field and I want to say let's just call us my dimension filter and all I'm going to say here is select a dimension equals state so yes or no does it equal state so in this particular called I'm sorry new true/false dimension called dimension filter I'm going to drag that to the filters and what I want is if I want the true to be excluded here so this is saying if they pick state don't show it so notice how it goes blank but if I pick customer name it comes back or if I pick product name it comes back I pick state and it goes blank ok so that's good so far so that let's call this our bar chart and then let's create another oops let's create another new sheet and this time we want to just we want to have a view by let's say so we can put dimensions let's just put state on the map and let's put sales all on the size all right so we're just sizing our you know just sizing the circles on our map and I want to put my same dimension filter here actually let me show my show my filter first select a dimension show ok so when they pick state this time I want it to be true so I'm going to drag the dimension filter choose true hit OK and now notice what happens when I pick customer named this one now goes blank so I pick product categories blank I go over here to bar chart and is showing up switch this one to state and it goes blank go over here to our map and now it shows up so let's call this one our map now neat thing you can do is you can put these together in a dashboard and make it give your users different views based on the dimension they pick so we could yeah so let's go ahead and put another let's start a new undo dashboard and I'll just make it you know nice small one for you here and what I want to do is I want to put both Sheetz in the dashboard and i want them to be within let's just stick them out there and the trick here is to hide the titles so you notice when I hide my title and I stick them both inside of a container so let me stick this in a container put the map in the container I'll put the other one in the container notice how it fills up the space so now if I pick customers customer name I see a bar chart if I see pic product at except category I see a bar chart and I can even make this fit the entire view and should fill up the space there we go customer name fills up the view that's kind of neat looking isn't it and then I could pick State and it flips over to a map so this is a nice neat way to give a dynamic to make it where it's like a user selected view for example so you could extend this to include a line chart even if you had maybe you want them to pick the dimension you want them to pick is order date or something like that then you could have a third one in here that is also a line chart so we'll call this one our what did I call it over here on my powerpoint I call this our just our dynamic view hopefully that one's pretty interesting too I like how its kind of swaps out you can see my other sheet is still here it's just really small so you can't really you can't really need them your users wouldn't even notice it okay so the next one is let's go ahead and look at the type add some dynamic date ranges so we're gonna now let's go ahead again let's pick quarter date and put that in the rows for the continuous days and let's go ahead and stick sales in the rows and just for sake of argument I'm just going to make it a moving average just to smooth it out a little bit edit that calculation and let's maybe make it a let's make it a 30 day moving average so I'm gonna pick 29 and then since I have include current check that means a 30 day moving average okay so we've got something like that so now what I want to do is I want to I don't know where this came from so let's delete that what I want to do now is I want to give my users the option to pick a start date and an end date for the view so I'm going to this time I'm going to right click on order date and choose create parameter so again the boot because I know the field I want to base it on if I choose create primary this way tableau will automatically pick the correct data type and all of those things for you already now in this example it gives us a list but I want to just go ahead and allow them to pick to pick any date and I'll call this our start date and hit OK and now we have a new parameter called start date so I'll show that and then I'm just going to duplicate that and then edit it and give it the name and date and then show that parameter control okay so now maybe I want my users so my user says you know I want to start looking at this on so this looks like it starts on January 1st maybe they want to start looking at it from February 1st of 2010 through January 31st of 2011 so maybe a whole year in that way ok so notice that nothing has happened in our view because we have until table what to do with these calculations so we need to create a calculated field and we'll call it our date filter and what we're going to say here is we want to say order date is basically we want to do like a between statement so I'm going to say order date is greater than or equal to our start date and order date is less than or equal to our end date that will result and again hit a boolean calculation so we're just going to drag that to the filters and say true and now you'll see that my first date on here is February first and my last date is January 31st so I this is a nice dynamic way to allow the user to customize the visualization so a neat thing you could do now is you could maybe even show the see in the title so you'll notice it just says sheet 11 now because it always tableau just defaults to the sheet name so I might want to say 13 30-day average sales from and then I could insert my parameters into my titles so my start date to my end date hit OK and then you can see it says 30-day sales you can see my title well update dynamically so if I switch this back to February first you'll see it goes February 1st 2010 to 131 2011 so this is a great way to use date ranges for use two parameters to set the date change okay two more to get through here um let's see let's see so this isn't moving it okay so maybe the next example is let's say we want to we want to do a user-defined moving average so if we look at our calculation here so let's I'm going to actually just drag this down into my measures and I'm going to call it my moving average sales and now if I edit this calculation what tableau is doing is it's saying give me the sum of sales do the window average that this is what moving average means of sales and it says it's saying look backwards 29 days and then stop when you get to the current day so so this is what this is how it counts 30 days well maybe we want our users to be able to specify this number of days to use for the moving average so to do that we could create another parameter and let's just call this one the smoothing and I'm going to make it an integer and let's say let's give the users a range so maybe they can do anywhere from a seven day moving average to a 90 day moving average and we'll just give them a step size of one okay and now if I show this if I show this parameter let me go ahead and duplicate this sheet first and then let's show this parameter control and you'll see that now we have it says seven-day smoothing I you know if I move this around it's not doing anything so what I need to do is I need to edit my or let's just duplicate this and now let's edit this field so I want to call I'm going to call this moving day our sales smoothing that way I know that it's coming where which field it's coming from and in this case what I want to do is I want to replace this twenty nine with my smoothing however what this is going to do is this is saying it's going from because you notice how the number seven is in my smoothing now this would be from minus seven to zero which is actually an eighth day moving average so in order for this to be a seven day moving average I then need to add one the reason I choose to do it this way is because I don't want my users to have to know that they need to offset their their choice by one day I want to do that for them so in other words if they pick thirty in in in the smoothing parameter they should expect a thirty day moving average so I don't want them to have to pick 29 just because of the way that tableau works so I'm going to do the I'm going to do that additional day for them so I'm going to hit OK and now I'm going to take this moving average smoothing and maybe I'll actually let's just combine them onto the same axis that'd be pretty cool so we have one that is doing a I think this one is doing a thirty day moving average if I edit this yes so the blue one is doing a thirty day moving average and the orange one is our custom moving day out so if I set this to thirty you'll see that they overlap each other perfectly but maybe I want to compare a thirty day moving average to a 60-day moving average and I could do something like that and if I want this one on top I'll just reorder them so that's a really really neat way to handle something like that so I don't know why you'd want to do a forty to a 42 day moving average but a common thing might be maybe we want to do a 21 day moving average and this allows you to compare the different moving averages so let's call this one are moving in days all right so the next one we want to get to is a dynamic scatterplot so I'm going to create a new sheet and this time what I want to do is I want to create a I'm going to create a couple of parameters so the first one I'm going to basically allow my users to pick a couple of different measures so I'm going to say choose x-axis and here I'm going to say I'm going to make this a string to the list and they could choose sales maybe profit what else do we have discount and order quantity I think that hit ok and what else do we have sales shipping costs maybe we could have chosen shipping cost do I have order quantity quantity ordered new yeah something like that ok good show that parameter control and you'll see we've got sales profit discount order quantity but again this isn't doing anything because we haven't told tableau what to do with it so I'm going to right click on my parameter and choose create calculated field notice this time I didn't go up to the triangle up here you can do it whichever way you want if you choose to do it based on if you create the calculated field from the parameter you get just tableau pre-populates that into the calculation for you so I'm going to just call this one my x-axis and I'm just going to do a simple case statement one sales then sum of sales when profit then some oops of profit when discount then average discount else order quantity new and I think I need to wrap this in a sum or maybe we want to do the average order quantity so let's do the average and okay and now we have a new measure called x-axis I'm going to drop that onto my x-axis and maybe I will go ahead and put my parameter to the left of that so then I can rotate the label and then hide the field labels double-click on the axis remove the title from the axis and now it actually does look like that belongs to the axis belong side that this does look like an axis title so when I change it to profit you'll see its profit change the discount you see it switches to average discount okay so now let's duplicate these fields let's duplicate our x-axis and let's just rename this one to y-axis and then let's duplicate our choose x-axis parameter and let's just rename it to choose hi axis alright so now we have our let's show that parameter and I need to edit my y-axis to just say lock axis okay all right so now this one is discount so let's switch this one to order quantity put this put our new y-axis measure on to the columns and we get a scatter plot and I can maybe put my choose y-axis there and hide the field labels and then remove the title all right so there we go so now we can maybe we want to we have this other field called dimensions selected right we have this selected dimension oops I don't want to do that this shows customer name products okay maybe that's okay so let's go ahead and show that parameter control and maybe I want to show the detail based on this parameter so I could take if you remember we created this calculation called dimension selected that basically returns the list of dimensions based on the parameter so I'm going to drag that to detail and now you can see that my I get a dot for every state or I get a dot for every summer day things like that and now I can maybe I want to compare my discount to my profit by customer name so very very good something really really simple like that so this is a great way to create a dict a dynamic scatterplot so let's call this dynamic scatterplot okay and the last one we want to do is filtering across data sources so let's go ahead and what I'm going to need to do for this one is I'm going to go ahead and go to a new worksheet and I believe I have region in here right if I do and I have maybe product subcategory and let's just look at sales by product category first my sales something very simple now I need to what I only have one data source in here so I'm going to go ahead and add another data source this time I'll do my maybe my coffee chain I think I have a coffee chain okay now you'll notice this one says market so I believe in so let's call this our let's call this our superstore sales let's create a new sheet and let's create a similar view so we've got markets for coffee chain and let's say for them we want to do maybe by let's say maybe type of product and maybe the product itself like oh there we go and let's look at the sales of the product okay so now what I want to do I'm going to call this coffee chain sales and what I want to do now is I want to create a if you'll notice when I drag market into the filters I have central east south and west and a superstore when I drag region in I have central east south and west okay so maybe we want to create a parameter that allows us to filter across these data sources so I'm going to create a create calculated field I want to create a swing delete that I want to create a parameter that is select a region and in this case what I want to do is I want to make it a string and I'm going to I can go down here to add from field order super store sales pick region and notice how it prepopulates it so in this example what this would do and when I show this you'll see it only allows my user to pick one at a time but I could also give my users the option to pick all so let me edit my parameter and I'm just going to make it look like it's a filter like we have an All option I'm going to move that to the top I'm going to go up here to all again you'll see it's not doing anything so I need to put a filter on I need to create a calculation that filters this view based on the region selected so I'm going to create a calculated field I'm just going to call it my region filter and what I'm going to say is that my selector region is equal to my region or select a region equals all and I have to make sure I put it exactly the way that I entered it into my parameter and then again this is going to result in a boolean calculation so let me show you how this works I'm going to put region into the view just so you can see it so they put reach into the columns and and I now have this region filter I'm going to drag that to my filter shelf and choose true okay doesn't look like anything happened when I pick central notice how it goes just to the central region when I pick West it goes just to the west region when I pick all it switches to all regions so that's kind of what the option is doing when I look when I include this or region equals all that's just saying is it equal all true okay so let's return them all so let's go ahead and take region back out and now we can create a we could also notice how the parameters can work across data sources so I'm going to show the parameter control here and basically I need to duplicate that in that calculation so in this chase I'm going to I'm going to call this one by market filter I'm going to say market equals select a region or select a region equals all hit okay and now we can put our market filter in the view choose true and notice when I if I put market up here into my columns you'll see it's just now central or just south or if I pick all it shows all markets okay so now the beauty of this is I could throw these together into a dashboard let's just go ahead and make it a 800 by 600 again and I can put superstore sales here I can put maybe coffee chain sales underneath of it or maybe next to it whichever your preference is and now I have this nice parameter that I'll just move to the top and let's go ahead and entire view view when I picked entire view there we go and now you can see when I pick central it filters both of them I need one parameter that's felting filtering to data sources so we'll call this our cross data source filter
Info
Channel: Andy Kriebel
Views: 174,984
Rating: 4.9423199 out of 5
Keywords: tableau, tip, parameters
Id: opfVV1maNVw
Channel Id: undefined
Length: 49min 48sec (2988 seconds)
Published: Tue May 03 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.