5 Replies Latest reply: Sep 6, 2012 4:21 PM by Brian Garside RSS

    mapping multiple values into 1 category

      Hi guys,

       

      I have a mapping of 3 product categories:

       

      ProductTypes:

      Mapping LOAD * INLINE [

      Col1, Col2

      1, Candy

      2, Cake

      3, Cookie];

       

      I use that mapping when loading my product fact table "Products" as:

      Products:

      LOAD

      ProductID,

      ApplyMap('ProductTypes', ProductTypeID, 'Unkown') AS [Product Types]

      ...

      FROM Products.qvd(qvd)

       

      Question: How do I create an additional (artificial) product type that will combine "Cake" and "Cookie" into Baking?

       

      I'm thinking of something like this:

      ProductTypes:

      Mapping LOAD * INLINE [

      Col1, Col2

      1, Candy

      2, Cake

      3, Cookie

      2 or 3, Baking];

       

      I need this in order to make ProductType a dimenssion and then display sum of products by product type as in table below:

       

      ProductType, Number of products

      Candy,   5

      Cake,   3

      Cookie,  6

      Baking,   9

      Total,   14

       

      Thank you in advance!