This is not very fancy way, but one proposal.
Duplicate data source and link with shifted date.
Create field for week base date on current data source.
[Order Date Week]
Then duplicate data source
On second Data source, shifted date of week.
[Order Date Week]
Link the fields.
You can not link "individual date" because there might be missing date in shifted week.
On second Data source, rename "sales" to "sales last period"
On primary Data srouce
[Sales Delta %]
(zn(sum([Sales]))-zn(SUM([Sample - Superstore (copy)].[Sales-last period])))/zn(SUM([Sample - Superstore (copy)].[Sales-last period]))
I went in to the workbook to verify the calculations, but the Sales-last period values are hit and miss. It either pulls the correct value (circled in green), wrong value (circled in red), or does not at all (typed in blue).
I'm trying to understand the formula to see where the problem is. My first confusion is the Order Date Week in the secondary data source.
If 1 week is added to the date, how is it pulling the week prior? I would imagine the DATEADD function to use -1. But apparently it works out correctly, as seen in the below screenshot:
1 of 1 people found this helpful
Thank you for th poting and sorry for the confusion.
Here is a background.
For + or - of "dateadd"
And we need to add 1 not minus 1
Then the issue exist in different arena.
So combination of week x Region create situation 6/15 has null but 6/8 has data (pink).
This is one of the negative side of this method.
Only work we don't need to filter region.
Then, I don't have good idea of alternative method....
Thank you Shinichiro. This is a clever idea.
Hi Shinichiro. This idea was working for me until I needed to publish the data. Once I did, Tableau gave me an error message. It couldn't copy the extract because of a "Data error (cyclic redundancy check)". The definition online says this checks to see if there data that does not provide additional information, meaning I copied the same dataset with the same fields and Tableau does not like that.
I'll keep your response as correct as it answered the initial question in this post. I just wanted to let you that this idea only works for desktop views.
Sorry I have no idea.
To where are you publishing? Tableau server or online,
I don't know the detail background, but did you try to publish Data sources and workbook separately?
I am publishing to Tableau Server 10.1.3 64 bit. I tried publishing the data source just now, and I received the same error message.