1 Reply Latest reply on Oct 29, 2018 1:24 AM by Yuriy Fal

    Join/Blend/Combine?...two columns of a datasource to generate statistics.

    Antonio Santos

      I have a datasource that looks like this:

       

      Date    

      DateCustomer Name
      City
      State
      Product 1
      Qtd (Product 1)
      Product 2
      Qtd (Product 2)
      10/19/2018John DavosTianguaCearaBeverage 112Beverage 210
      10/05/2018Maria SilvaFortalezaCearaBeverage 35Beverage 12

       

      What I need to do is to generate statistics on Products by item, quantity, category, etc, but I can't seem to wrap my head around having the dataset set up for that.

       

      Any help is appreciated.

       

      Antonio

        • 1. Re: Join/Blend/Combine?...two columns of a datasource to generate statistics.
          Yuriy Fal

          Hi Antonio,

           

          The 'right' name is Un-Pivot :-)

          This is a kind of data transformation that transpose columns into rows.

           

          In Tableau there is the Pivot option available for some (not all) data sources.

          But it couldn't apply in your case, because Tableau can do (Pivot) only one set of columns,

          and you need it to apply twice (or more) -- for both Products and Qtds (or other metrics as well).

           

          The Un-Pivot is logically equivalent to UNIONing your datasource table (twice or more)

          and Aligning the respective Columns into a single one(s) via simple calculation(s).

           

          Please find the attached as an example of the latter approach.

          Hope it could help.

           

          Yours,

          Yuri

           

          BTW, you can make two (or more) consecutive Un-Pivot steps in a Tableau Prep flow.