Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

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!

Cindy

1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

3 Replies
somenathroy
Contributor III

Re: Calculated Dimension AGGR function + Set Analysis

Can you pls. upload a sample app.

Not applicable

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

View solution in original post

sr_qlikview
Contributor

Re: Calculated Dimension AGGR function + Set Analysis

can you please share the corrected expression.