3 Replies Latest reply on Nov 27, 2018 9:54 AM by Raj Cheruvu

    long vs wide data source, how to.

    gene shackman

      I hope this is a simple question. I have a data source, attached. I use the wide version ("sheet4" in the excel file) to make a vis (attached). I know how to do this with wide data (instructions attached), but I don't know how to do this with long form of the data ("sheet4long" in the excel file). Is there an example on tableau or anywhere else to show me how to do this? Or a few hints? Should be easy, but I searched around and couldn't find it.

       

      Thanks

        • 1. Re: long vs wide data source, how to.
          Joshua Milligan

          Gene,

           

          This is a great question!

           

          Often working with a wide data source is more difficult than working with a long data source.  In this case, using the long data source will make you adjust how you treat the dimension (sociodem) as it contains quite a few values which are not all mutually exclusive.  The trick is to filter to just the applicable values:

           

          For example, here I've filtered to keep only male or female.

           

          Also, you may have to use the drop down on [Percent/Cl] to change the data type to decimal.  There are some values which will become null (because they were strings that represented ranges).  If those are still important, you may want to make a copy of the field to retain the string values too.

           

          As far as resources to understand tall vs. wide -- I've picked up a lot from these forums and I included a large section on the differences (and how to work with both) in chapter 11 of Learning Tableau </ShamelessPlug>

           

          Hope that helps!

          Joshua

          1 of 1 people found this helpful
          • 2. Re: long vs wide data source, how to.
            gene shackman

            Thanks. This helps somewhat. I modified the excel file to add more columns, defining the groups. So, all the data in one column. All the different categorizations in various columns. One column for year, another for what type of grouping (gender, race/ethnicity) another for what type of data (percent, confidence intervals), another for the sociodemographic group within the grouping (gender-male, gender-female, RE-Asian, RE-Black, etc).

             

            I got the chart, by using filter. Instructions and chart are attached.

             

            I still don't know how to do the tables, though.

             

            Thanks

             

             

            • 3. Re: long vs wide data source, how to.
              Raj Cheruvu

              Can I unpivot my data in tableau?  I have a file that is 100,000 rows and 40 columns in Excel.  I need to unpivot on the last 20 columns for a viz my boss wants me to do..  I have done this viz with a smaller dataset that I could easily unpivot.  Can I load the file to Tableau and then unpivot it?