Challenge accepted! I was able to achieve what you were looking for (minus the arrows) but I had to restructure your data. Here's what my final result looked like:
I did this by using a dual axis plot with the value in path and in shape. Check out my attached workbook.
Here's how I reshaped your date:
Is this possible for you? For ID C, I see that Last Week is 07/01/16 and This Week is 01/01/16. Is this a typo? If so, we don't need the Week column as we can identify this week and last week in tableau.
Motion Plot.twbx 16.4 KB
Stephen, this is great! I think where I have become unstuck is if an ID has
the same date for 'this week' and 'last week' but a different value for
'this week' and 'last week', the lines won't show. Ideally it would show a
vertical line between the two values on the same date.
On Thursday, 7 January 2016, Stephen Lavery <
Yeap, we can do this. To resolve this issue we need to change the 'Value' into a dimension rather than having it SUM. I added an extra point E which has the same date for 'this week' and 'last week' but with different values to show you.
To do this right-click the value pills in the rows shelf and select dimension:
I've attached the package workbook so you can take a look.
Motion Plot 2.twbx 18.3 KB
This is perfect help. Exactly what a newbie like me needed - very valuable.
I have everything working, the solution is perfect. The next challenge is seeing the lines across time periods with multiple dimension pills.
For eg: If I want to see changes by week AND month, the lines don't go across the month dimension.
See when using only Week Number
When adding Month dimension to distinguish which week is in which month:
See lines only show for changes that exist within the same month. Changes that happen across months - the line disappears.
I believe I understand why that is happening. Do I need to create one dimension pill that has the data increments that I want? Maybe using Datepart?
Thanks again for all your help!
I continue to plug away at this, and have a couple more things - which you
seem to be easily able to answer with ease!
1. How would I handle a third time period, and then creating some kind of
toggle button with a filter to be able to switch between the two.
For eg: What if I wanted to choose to compare 'this week' and 'last week'
OR compare 'this week' and '2 weeks ago'
2. With this addition of a a third time period, how would you then go about
EXCLUDING and IDs where no change has happened.
When I had two time periods, I basically used: If Fixed :min (date) =
fixed :max (date) AND Fixed :min (value) = fixed :max (value).
With three time periods, I will have to get a bit more creative?
On Sat, Jan 9, 2016 at 3:22 AM, Stephen Lavery <
Regarding the date question you're right, we need to create one field which is week/month. This is not a default tableau date format and I'm not sure how to create it as a date function but it can be done as a string:
To do this I created a new calculated field Week/Month which looked like this:
"Week" + " " + STR(DATENAME('week', [Date]))+"
Copy and paste that in and it should work for you. The problem with creating this calculation is that it is no longer recognised as a date...
With your 2 newest questions I'm not sure that these will be possible to do after having converted the date to a string. For Q1, this might be possible with a parameter.
Sorry I can't help you any further on this one. Maybe post these up as separate questions are hopefully someone else will be able to help you out!
Thanks Stephen, your help is truly great.
I will try the date trick.
I was able to solve the solve the latest question by continuing to use the
FIXED functions, but then fine-tuning with context filters. NICE!
On Mon, Jan 11, 2016 at 11:25 PM, Stephen Lavery <
Great stuff! Glad I was of help.