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

# 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.

Cindy

• ###### Re: Calculated Dimension AGGR function + Set Analysis

Can you pls. upload a sample app.

• ###### Re: Calculated Dimension AGGR function + Set Analysis

Hi guys,

I figured it out myself!

Seems I had my "sum" expression in the wrong place.

Thanks

Cindz

• ###### Re: Calculated Dimension AGGR function + Set Analysis

can you please share the corrected expression.