Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

aggr working on version 11 but not 12

Hi guys

The following is working perfectly in version 11, but not 12. Please help.

The expression is:

=min(aggr({<AsOfDate={'>=$(vMinDate)<=$(vMaxDate)'},FromDate={'>=$(vMinDate)<=$(vMaxDate)'}>} exp(sum(log(1+Return)))-1,PortfolioName,FromDate,AsOfDate))

The variables are defined below:

vMinDate: Max(TOTAL aggr(Min(ReturnDate),PortfolioName))

 

vMaxDate: Min(TOTAL aggr(Max(ReturnDate),PortfolioName))

 

Thanks.

Joao

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Are you sure this works in QV11.2? Because it looks syntactically incorrect - AFAIK Aggr() does not support set expressions directly, they need to be in an aggregation function such as Min(), Sum(), Avg()....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

I see what you mean, and it certainly underlines many parts of the expression for this reason (suggesting there is a problem), but it has always worked. I've upgraded a couple of installations to version 12, and on these it is not working. The rest are still on 11.2, and it works perfectly (no changes i.e. we are all using the same models).

Anonymous
Not applicable
Author

And I've tried changing the expression so that it is syntactically correct with the exp(sum( straight after the aggr( so that the set analysis happens inside the sum, but it still doesn't work. The new expression is:

=min(aggr(exp(sum({<AsOfDate={'>=$(vMinDate)<=$(vMaxDate)'},FromDate={'>=$(vMinDate)<=$(vMaxDate)'}>} log(1+Return)))-1,PortfolioName,FromDate,AsOfDate))

Anonymous
Not applicable
Author

I've just removed the set analysis part out of the expression, and this works perfectly i.e. the expression is now:

=min(aggr(exp(sum(log(1+Return)))-1,PortfolioName,FromDate,AsOfDate))

Not applicable
Author

I feel like variables work differently in version 12+ and Qlik Sense than they do in previous versions...