6 Replies Latest reply: Dec 3, 2014 4:29 AM by neetha P RSS

    Calculate age, display in buckets

    Andrew Houston-Floyd

      Hi everyone,

       

      I have inventory of different products, in a dataset covering several years. I want to calculate the age of each product in each year, dynamically group the products into age buckets based on your selected years, and then display those age buckets in a pie chart. How do I implement this?

       

      So if my dataset currently looks like this:

       

      Year   Product   Delivery Year

      2010   A                    1999  

      2011   A                    1999

      2012   A                    1999

      2010   B                    2002

      2011   B                    2002

      2012   B                    2002

      .... etc

       

      I want to add Age

      Year   Product   Delivery Year     Age

      2008   A                    1999             9

      2010   A                    1999            11

      2011   A                    1999            12

      2012   A                    1999            13

      2010   B                    2008             2

      2011   B                    2008             3

      2012   B                    2008             4

      ... etc

       

      I then want to group Products by Age group of 0-5, 5-10 Years for the selected time period. So if I selected 2008, the group count would be:

      Group     Distinct Product

        0-5                  1

      6-10                  1

      11-15                0

       

      But if I selected 2012, the group count would be:

      Group     Distinct Product

      0-5                    1

      5-10                  0

      11-15                1

       

      If I selected 2008-2012 in the QVW, I would want it to calculate off the latest year, 2012.

       

      Finally, I would then want to display this group count in a pie chart.

       

      Can anyone please tell me step-by-step how to implement? Thanks!

      :