-
1. Re: Plotting graph based on this this week's date as well as same days last week
Kent Sloan Oct 20, 2015 12:01 PM (in response to babu ironman)Hello Babu,
Below is the formula I used to create the groups you described. I also included a parameter driven version where the user can select the number of days to go back and how many days to compare. To pick up some more of the basics of Tableau I would recommend checking out the InterWorks Tableau Essentials blog series. For general reading I would lookup the list of Tableau Zen Masters and look over their blogs. I hope this helps!
IF [Date]<=DATEADD('day',-3,TODAY()) AND [Date]>=DATEADD('day',-5,TODAY()) THEN "This Week"
ELSEIF [Date]<=DATEADD('day',-10,TODAY()) AND [Date]>=DATEADD('day',-12,TODAY()) THEN "Last Week"
END
Thanks,
-
Dates Example.twbx 37.2 KB
-
-
2. Re: Plotting graph based on this this week's date as well as same days last week
babu ironman Oct 20, 2015 9:56 PM (in response to Kent Sloan)Hi Kent,
The solution looks great. Thank you so much.
However is there anyway we can get the solution like below:
First get the recent 3 dates(today, yest and day before yest) using datediff or dateadd, then use LOOKUP to get last week's date and data??
-
3. Re: Plotting graph based on this this week's date as well as same days last week
Kent Sloan Oct 21, 2015 8:05 AM (in response to babu ironman)Hi Babu,
I personally would avoid using a table calculation for this unless there was a situation that required it. Attached is an updated version of the example that uses a table calc to lookup the percentage for the previous week.
Thanks,
Kent
-
Dates Example.twbx 68.4 KB
-