2 Replies Latest reply on Jul 21, 2016 6:00 AM by Kevin Hildebrandt

    Recategorizing existing data to be viewed differently

    Kevin Hildebrandt

      Hi Everyone,

       

      I need some help with adding a New Category which will allow the data to be viewed differently based on what was ordered.

       

      Using the example below, this New Category is not part of the Customer Order File and needs to determine how each order is to be further categorized; Writing, Creating, or Hybrid order. The Customer Order File has one row for each item ordered. Each item has an associated Category which could be used to determine the New Category since there are fewer of these than Part #'s. Each line item within an order needs to be interrogated to determine the New Category classification. This is basically adding a virtual column to the Customer Order File

       

       

      Any help and guidance is appreciated.

       

      Best Regards,

      Kevin

        • 1. Re: Recategorizing existing data to be viewed differently
          Naveen Agarwal

          You can create a new Dimension (New Category) where you can assign values based on the Associated Category in the Customer Order File. For example, if "Pencil1" = "Writing" and "Crayon1" = "Creating", you could use the CASE function

           

          CASE [Category]

          WHEN 'Pencil1' THEN 'Writing'

          WHEN 'Crayon1' THEN 'Creating'

          END

           

          You will need to link each entry in the Category with the corresponding entry in the New Category list.

           

          Hope this helps.

          1 of 1 people found this helpful
          • 2. Re: Recategorizing existing data to be viewed differently
            Kevin Hildebrandt

            I appreciate the introduction to the CASE function. This will help with less prep work on a file prior to bringing it into Tableau since it works on an individual record/row; I work a lot with spreadsheets. My need is to somehow evaluate all records/rows in an order and then determine which New Category to assign to it.

             

            Today this involves a 2-step process where I create a pivot table to consolidate the records/rows into a single record/row. I then create some new columns and use a combination of IF statements and a VLOOKUP to come up with a New Category. This is time consuming and increases the file size. I would rather bring the raw data into Tableau than to have to continue data manipulation in Excel.