This post should guide you on the technique to use a parameter to select a time period and using the parameter within a calculated field to change the time period displayed. This post covers Week and Month but easily adapts for your situation. Business AnalyticsWeek and Month Date Hierarchies in Tableau, build a hierarchy Tableau
not quite what I was looking for msa s.
I wasn't looking to filter months, years.
I want to be able to create a quick parameter that would allow the user to change the marks from month, to quarter, to year.
Notice in the image how I had to manually change from QUARTER to MONTH in the MARKS section, that way the display would show more granular info, but also carry over the proper labels and colors for each line.
tried to follow this, but it either doesn't fit what I'm looking for or its just over my head.
This seems to be modifying the timing that is on the columns.
I already have that as a static item called [Loss Timing (Adjustable)].
I want to leave the Columns and Rows alone.
All I want to modify are the fields in the Marks area...
I'm wanting to see if a parameter can be created for someone that can simply choose Month, Quarter, or Year and it will change that setting for the marks. That way you can see in the initial 2 images up top where you saw 4 lines (quarters for 2012) then became 12 lines (months for 2012).
Hope that all makes sense. I'm not on point with all the tableau lingo just yet.
I'm just a simple caveman...
1 of 1 people found this helpful
The link provided should help but I'l try and describe here as well. You will need to modify the calculated field somewhat to handle the formatting of your date but you should get the principle of it here.
Create your parameter with the values month, quarter and year. Case sensitivity is important here but you can display the numbers with caps where appropriate.
Create a calculated field with the formula: DATEPART([ParameterField],[Date : funded]). Putting that field on the marks card should give you the number of bars expected. However this may not do the formatting part, in which case you would have to create another calculated field (or replace the previous one just created) to format the date appropriately - i.e. IF [ParameterField] != 'year' THEN DATENAME([ParameterField],[Date : funded]) + ' ' + STR(YEAR([Date : funded])) ELSE STR(YEAR([Date : funded])) END
I'm not in front of tableau now to test any of this but it should (hopefully) work.
Totally makes sense and I think we're getting close... the only snag is when I attempt to embed a parameter control within the DATEPART or DATENAME function, it gives me an error in the calculation
Argument 'Month' to DATENAME must specify a datepart ('year', 'month', etc)
Argument 'Month' to DATEPART must specify a datepart ('year', 'month', etc)
I hope there's a way around this... since it seems to be right on track for what I'm hoping to do.
I overlooked the case sensitivity, you were right on point there... fixed it to lower case strings and it worked cleanly when 'year' is selected.
I need to find a way to get it to display as a continuous variable, for the Label to show up clean.
The Dimension ends up goofing up how the curves look.
You've gotten me 75% of the way there, now just to get it to display the way I would prefer.
figured it out, was able to simply go into the label properties and have it only label on the line ends and it still worked cleanly as a attribute instead of a dimension or a continuous variable. Appreciate the help. You took care of the tough part for me.