4 Replies Latest reply on Oct 12, 2018 12:35 PM by Ken Flerlage

    Why does the order of fields on Marks Card matter?

    Mikhail Christiansen

      Hello everyone,

       

      I just came across the strangest thing trying to build Ian Baldwin's Superstore Sankey diagram. My chart was not showing any results though I was absolutely sure that I followed Ian's instructions precisely. I deleted the sheet and tried again from scratch, but had the same results. Finally, I downloaded his workbook (thank you for posting, Ian!) and attempted to mimick EXACTLY what he had on his sheet. That is when the strangest thing happened and I have no idea why it made any difference to Tableau. Please help me understand this.

      This is a screenshot before the change:

       

      This is a screenshot after the change:

       

      The change: I moved "Dimension 2" (detail) on the Marks card above "Path Frame (bin)" (detail). Now, all the sudden I have values and color and starting to see the beginnings of a sankey.


      What in the world happened? Can someone explain to me why moving that field on the marks card made any difference to Tableau?

       

       

      Thanks!

        • 1. Re: Why does the order of fields on Marks Card matter?
          Ken Flerlage

          I know this doesn't exactly answer your question, but before we get to that, I think you have a bigger issue here. Notice that, if you click on one of the sankey polygons, then things get a little weird. Is this intended?

          • 2. Re: Why does the order of fields on Marks Card matter?
            Michael Hesser

            I going to make a crazy guess: think you're creating too many Polygons, and changing the order of your dimensions in the marks card changes the order in which the polygons are filled.

             

            Try this exercise:

            • Turn the color to almost transparent-- you'll see many overlapping polygons.
            • Now change the chart type from polygon to circle (this works best if you increase the size of the circle and reduce the width). This is a very useful visualization, because swapping the order of the marks makes no difference. What it WILL show is how the order in which lines overlap changes.
            • You'll also see each region has 5 lines: Is this how many you need? Or do you need just 2?  It's possible you're creating too many polygon lines, and changing the order in which they are grouped.

             

            I admittedly don't know much about polygons or drawing with lines with Tableau. But just playing with the LINE function in your viz (and with my wealth of dot-to-dot experience gained from some of the finest restaurant place mats), it seems like there needs to be a particular order to the dots:

             

            Cruse across the top (from L to R), join with bottom, cruise along the lower curve, join with the top, color in.

             

            Otherwise, you'll be bouncing up and down-- or something potentially weirder (like when you move COLOR down a notch-- suddenly you have TRIDENTS!)

             

            As Ken Flerlage pointed out, there's some "funkiness" going on in your formulas. I'd make sure your Sankey Polygon is just creating the bare number of line segments for each region and then (knock on wood) your sort order should sort itself out

             

            • 3. Re: Why does the order of fields on Marks Card matter?
              Michael Hesser

              To maybe give a little more weight to Ken Flerlage's observation, look what happens when we change your mark type to circles and set Dimension 2 to be the same as Dimension 1 (Region, Region); we get something like this:

               

              To my untrained eye, these secondary lines seem suspicious. If we're comparing like with like, shouldn't all lines be horizontal? This would suggest (as Ken's saying, I think) that something may be amiss in one or more of your calculations.

               

              Here's a different way of looking at it: I transformed your viz into a dual axis graph show I could assign different colors per side (dimension 1 and dimension 2). I set Dimension 1 as Region and Dimension 2 as Category.

               

              As we focus on the LEFT side and we highlight through the Regions (South, Central, East, West) we see just what we're after: separate, non-overlapping "stacks."  Each has 3 branches (one per Category - Dimension 2).

               

              But as we cycle through the Categories (the right side of the axis), we realize there's a problem:

              Technology looks OKAY: four branches on the left (one per unique Region) and one stack on the right. But our right stack is overlapping.

               

              Moving to Furniture:

              ...we see non-overlapping branches on the left, but our right-side stack overlaps itself AND values in Technology.

               

              The same problem exists with Office Supplies:

              It takes up almost the complete right hand side. So... I think something is wrong in your Dimension 2 calculation.

               

              I've attached my "sandbox" so you can play around in it. I wish I could better resolve your question, but hope this will lead to an answer. You might even try reaching out to Olivier CATHERIN, who is a real guru of Sankey. Good luck!

              • 4. Re: Why does the order of fields on Marks Card matter?
                Ken Flerlage

                One other thing I can offer is a relatively simple template for building a sankey. It's meant to be plug-and-play and is based on the work of Olivier Catherin and Jeff Shaffer. Chart Templates Part 1: Sankeys - Ken Flerlage: Analytics Architecture, Strategy, & Visualization