Is this the expected output?
If yes, you can see that I have applied a filter as shown above, and added all the other filters to context by right-clicking on them.
Hope this helps.
I'm not sure how the data is being presented to tableau, but it looks like it's only ending up with part of the date in the transaction day field, with the year coming in a separate field 'Year'.
That makes it fairly simple to piece them back together to get the full date in one field - which would make things a little easier to use. I created a new calculated field 'Transaction Day - corrected' using the calculation:
MakeDate(int([Year]) ,month([Transaction Day]) ,day([Transaction Day]) )
That takes the day and month from your existing transaction day and combines them with 'Year'.
If you only want the last ten days of this year, you could filter on this directly using relative date or a top(n) filter - but that would include the current day could give partial data depending on how things get updated.
For more complicated date logic I usually create a calculation to work out the "Relative Day" - with yesterday being -1, today being 0, and tomorrow being 1. On your data that could be done with the calculation:
datediff('day',today(),[Transaction Day - corrected])
If you want to filter to show the last ten days plus the equivalent period from previous years - then the calculation would be a little more complicated:
,datediff('year',[Transaction Day - corrected],today())
,[Transaction Day - corrected]
I've attached a copy of your workbook with examples of these two methods.
Last 10 days example.twbx 2.7 MB
Thanks for your answer. This helps but unfortunately it doesn't give me the information I am looking for. I would like the cumulative number of Registrations since the beginning of the year. Right now the numbers show Registrations within the last 10 days only. We don't have the Registrations that occurred before 01/19 taken into account. But I would like them to. Any thoughts to have them included?
Thanks for your feedback! But i have the same answer as for Hari. I would like the cumulative number of Registrations since the beginning of the year. Right now the numbers show Registrations only within the last 10 days only. In other words, we don't have the Registrations that occurred before 01/19 taken into account. But I would like them to. Any thoughts to have them included?
1 of 1 people found this helpful
OK. Is this what you are expecting?
To achieve the above, I have created 2 calculated fields as shown below:
Temp Date Computed: MAKEDATE(YEAR(TODAY()),MONTH([Transaction Day]),DAY([Transaction Day]))
IF [Temp Date Computed]<=TODAY() AND [Temp Date Computed]>TODAY()-10 THEN
I have placed the Show/Hide value as given below, then hide the "Hide" values, and suppress the "Show" header.
Hope this helps.
This is really helpful Hari, thanks!
How did you hide the "Hide" values?
You can right-click on the "Show/Hide" field and should see an option to view the hidden data. Then you can display the header too. Once, you see the header, you can hide it by right-clicking on it.
Great! Thank you Hari!