Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
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
amartinez35
Partner
Partner

Hi,

You can try :

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


Aurélien

alexandros17

try this:

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

jonathandienst

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

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

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

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.