8 Replies Latest reply on Jan 16, 2016 3:45 PM by Mike Waldren

    Motion plot

    Mike Waldren

      Hey everyone!

       

      I have a challenge for you (well it is for me!)

       

      I am loving this movement plot.

      https://www.interworks.com/blog/pmathewson/2014/11/10/tableau-viz-scatter-plot-twist-movement-plot

       

      I want to create something similar, but to changes in datasets over time.

       

       

      With data set looking like:

      The dates/id are obviously a dimensions, and the values are measures.

      I would love a hand in building this - an example workbook would be great for me to walk through. Im not really concerned with the formatting of the picture, just the logic.

        • 1. Re: Challenge: Motion plot on a time series
          Stephen Lavery

          Hi Mike,

           

          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:

           

          Capture1.PNG

          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:

           

          Capture.PNG

          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.

           

          Kind Regards,

          Stephen

          • 2. Re: Challenge: Motion plot on a time series
            Mike Waldren

            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.

             

            Any ideas?

             

            On Thursday, 7 January 2016, Stephen Lavery <

            • 3. Re: Challenge: Motion plot on a time series
              Stephen Lavery

              Hi Mike,

               

              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.

               

              Capture.PNG

               

              To do this right-click the value pills in the rows shelf and select dimension:

               

              Capture2.PNG

               

              I've attached the package workbook so you can take a look.

               

              Kind Regards,

              Stephen

              • 4. Re: Challenge: Motion plot on a time series
                Mike Waldren

                Stephen!

                 

                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!

                • 5. Re: Challenge: Motion plot on a time series
                  Mike Waldren

                  Hi Stephen,

                   

                  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?

                   

                  Thanks

                   

                  On Sat, Jan 9, 2016 at 3:22 AM, Stephen Lavery <

                  • 6. Re: Challenge: Motion plot on a time series
                    Stephen Lavery

                    Hi Mike,

                     

                    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:

                     

                    a.PNG

                     

                    To do this I created a new calculated field Week/Month which looked like this:

                     

                    "Week" + " " + STR(DATENAME('week', [Date]))+"

                    "+STR(DATENAME('month', [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!

                     

                    Kind Regards,

                    Stephen

                    • 7. Re: Challenge: Motion plot on a time series
                      Mike Waldren

                      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!

                       

                      Thanks

                       

                      On Mon, Jan 11, 2016 at 11:25 PM, Stephen Lavery <

                      • 8. Re: Challenge: Motion plot on a time series
                        Stephen Lavery

                        Great stuff! Glad I was of help.

                         

                        Stephen