3 Replies Latest reply: Mar 29, 2013 9:24 AM by SRINIVAS sc RSS

    Calculated Dimension AGGR function + Set Analysis

      Hi guys,


      i'm trying to use a calculated dimension to define products as "New Launches" or "Existing" products.

      I've got a similar expression that calculates what price bracket they fall into, its working nicely also using AGGR.


      I am having an issue with the time periods specifically. Think my set analysis is wrong.


      I want the user to select some sequential months and for the expression to compare the selected time period to the previous (unselected time period) to determine whether it is new or not. So if there are sales in the selected time period and NO sales for the period before then the product is logically a "New Launch" or else it is an existing product.


      This expression below isn't working and I'm sure it's because of the set analysis trying to exclude the selected period.


      if(aggr(if(Period<= vMaxMonth and Period >= vMinMonth,sum(Value)),Description,Market) > 0 
           and sum({<Period=>}aggr(if(Period<vMinMonth and Period>=vMinMonthTotal,Value),Description,Market)) = 0 , 'New Launch', 'Existing')


      vMaxMonth is a variable = the latest month selected

      vMinMonth is a variable = the earliest month selected

      vMinMonthTotal is the earliest month in the database


      Value is the Sales

      Period is my time dimension.

      Description is the products.

      Market is the total market.


      Thanks for your help!