Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis, Aggr and priorities

Hi,

After so many tries, I need some help!!!

Expression:

=sum({$<year1={'2012'}, year2=>} aggr(totalvalue,codemp))

It seems that first QV is executing "aggr(totalvalue,codemp)" without taking account only fields filtered by "{$<year1={'2012'}, year2=>}".

I also tried, for example:

sum({$<codemp = P({$<year1={'$(=getfieldselections(year2))'},year2=>})>} aggr(totalvalue,codemp)

Can you help me? What is the correct way? Because totalvalue needs to be aggregated by codemp...

Thanks a lot.

7 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can try :

=sum({$<year1={'2012'}, year2=>} aggr(Sum(totalvalue),codemp))


Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
alexandros17
Partner - Champion III
Partner - Champion III

try this:

Sum(Aggr(sum({$<year1={'2012'}, year2=>} totalvalue),codemp))

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I am not sure what you are trying to do, but have you tried a straight table with codemp as the dimension  and

     =Sum({$<year1={'2012'}, year2=>} totalvalue)

as the expression?

HTH

Jonathan

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

Thanks for all...

I have a BI very complex joining a lot of systems. I have a sheet that is a summary of the information, so I need to manually set and clear some fields.

What I need in this expression:

1. year1 is empty and needs to be equal to year2

2. year2 needs to be cleared

3. sum totalvalue aggregated by codemp

4. it will be in a text box

Not applicable
Author

try below

aggr(Sum({$<year1={'2012'}, year2=>} totalvalue),codemp)

or

aggr(sum( if Year1= 2012 and year2<>0, totalvalue)),codemp)







Josh_Good
Employee
Employee

Try

=sum({$<year1={'2012'}, year2=>} aggr({$<year1={'2012'}, year2=>} totalvalue,codemp))

Not applicable
Author

Hello,

Your expression makes sense... it's exactly what I need. I need to show to "AGGR" that it needs to respect the set analisys.

But after AGGR I can not have set analisys "{}".... It should have some aggregate function as well.

Thanks.