Set up your report with a relative date filter of today. When you publish a report it maintains the dates which you published - hence it should be published with a relative (green pill) date filter.
Thank you Andrew for your response. I was not able to apply relative date filter of today as i have a metric with a prior four week average calculation. This filter also impacts my calculation. Would you have other suggestions?
Sure, you could use a calculated field to load your measure(s) and also the four week average calc. For example:
Todays Sales: IF [YourDateField] = TODAY() THEN [Sales] END
FourWeekAvg: IF [YourDateField] = DATEADD('week',-4,TODAY()) THEN [Sales] END (...or something like this, I don't know the structure of your 4 week average calculation)
It is very simply that your requirement of filtering is not "mutually exclusive" which create the confusion in logic....
when you want to apply today() Filter on the tableau report which actually exclude remaining data other than today , that implies your average of last 4 weeks can be calculated since data till yesterday was filtered out.
Can you please elaborate us with exact data set and requirement for which we can come up with a most probable solution.
Thanks & Regards
Hi panjala Srinath,
Thanks for your message. I have an hourly report, which refreshes every day on an hourly basis. There are two metrics on each chart: current hour and prior 4wk avg for the same hour. I am using the following date filter to limit my chart to display only one day, but maintain correct prior 4 wk avg calculation:
datetrunc('day',lookup(min([Date]),0)) = [Date Range] Note: Date Range is a parameter which pulls all date values
I am using the following formula for the prior 4wk avg calculation:
Currently, the date parameter displayed in the report defaults on the day report was published to the server. I would like the parameter to default on the latest refreshed date (current date) rather than the date the report was published.