-
1. Re: date parameter
Andrew Watson Jul 13, 2012 3:31 AM (in response to Anna Chan)Hi Anna
You can have a parameter control the date from multiple data sources. You need to create a calculated field using that parameter in each data source. For example you would have something like IIF([DateField] >= [DateParameter],1,0)
Make sure this is a dimension - i.e. drag it from the measures to the dimensions - then put it into the filter field on each of the worksheets which are using the different data sources and set the value as 1. This field will have to be created for each data source but each data source can use the same parameter.
Andrew
-
2. Re: date parameter
Anna Chan Jul 13, 2012 4:05 PM (in response to Andrew Watson)i have attached a workbook can you please provide an example?
-
Help File.twbx.zip 251.5 KB
-
-
3. Re: date parameter
Andrew Watson Jul 14, 2012 4:35 AM (in response to Anna Chan)Hi Anna
It looks like you're workbook was in tableau 6.1 so you won't be able to open the version I've done in 7 so I'll describe the steps based on what you sent through instead.
1. Duplicate the Date parameter you have already created
2. Name one of the parameters StartDate and the other EndDate and 'Show Parameter Control' for both of them
3. Create a new calc field in the Daily Mentions data source called DateFilter. The formula is IIF([Date]>= [StartDate] AND [Date] <= [EndDate],'true','false')
4. Drag this to the filter shelf and set the value to TRUE
5. Repeat steps 3 and 4 for the Sentiment data source
6. Remove your original date filters from the filter shelves leaving the parameters as the filter
Note this can't be a single date slider, unfortunately this isn't possible using parameters, and also parameters don't update dynamically based on the underlying data (unfortunately but hopefully this will happen in a future release of Tableau) so you may need to load some future dates into your parameters as well.
Andrew
-
4. Re: date parameter
Anna Chan Jul 16, 2012 2:12 PM (in response to Andrew Watson)Hi Andrew -
I am having trouble with the calculated field.. i typed in the formula and i am getting an unterminated string error. i also have tableau 7 installed on my work computer so the version and backwards compatability issues are not a problem.I have attached a image of the error i am currently seeing.
Thanks,
-
5. Re: date parameter
Tracy RodgersJul 16, 2012 2:23 PM (in response to Anna Chan)
Hi Anna,
The calculation needs an extra parenthesis before [Date]. This should allow the calculation to work.
Hope it helps!
-Tracy
-
6. Re: date parameter
Anna Chan Jul 16, 2012 2:45 PM (in response to Andrew Watson)the parameters only work with the start date, the end date parameter appears to have no impact on selecting the data... is there a fix for this?
-
7. Re: date parameter
Shawn Wallwork Jul 16, 2012 2:53 PM (in response to Anna Chan)Hi Anna!
You've got that [EndDate] >= to itself, so it's always going to be true. You probably meant [Date]. I bang my head on these little errors all the time, just part of coding I guess.
--Shawn
-
8. Re: date parameter
Anna Chan Jul 16, 2012 3:09 PM (in response to Shawn Wallwork)i changed the formula to equal date, but it seems like both are now controlling the start date and the end date parameter still isnt being controlled?
-
9. Re: date parameter
Shawn Wallwork Jul 16, 2012 3:30 PM (in response to Anna Chan)Anna, if you'll post your latest effort I'll give it a look and see if I can see what the problem is.
--Shawn
-
10. Re: date parameter
Anna Chan Jul 16, 2012 4:32 PM (in response to Shawn Wallwork)Feel free to use 7 as i have both 6 & 7 installed on my computer
-
Help File.twbx.zip 256.9 KB
-
-
11. Re: date parameter
Tracy RodgersJul 16, 2012 4:48 PM (in response to Anna Chan)
Hi Anna,
I believe the issue is that the way the calculation was set up was returning the incorrect results. Change the formula to look like the following:
IIF(([Date])>=[Start Date] AND [Date]<=[End Date],'true','false')
Hope this helps!
-Tracy
-
12. Re: date parameter
Andrew Watson Jul 17, 2012 2:18 AM (in response to Tracy Rodgers)Exactly, the only problem was a typing error in the formula.
Andrew