Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to exclude some fields using set analysis with aggregation function
I am using below sample expression
Sum(Aggr(sum({$<A={'3'},B={'AP'}>}Total),dim))
I want to apply Aggr function only for B instead of both (A,B). Is it possible?
Not sure what you are after, but may be this
Sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))', '$(=$(Var3))'}>}Aggr(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total)*(
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total))-
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Total))),dim))
I don't think you fully understand the role of AGGR and the role of Set Analysis.
Can you please describe the analytical problem that you are trying to solve, in non-technical terms?
Cheers,
Oleg Troyansky
Upgrade your Qlik skills at the Masters Summit for Qlik - coming to Boston, MA this October!
Please see below thread..
https://community.qlikview.com/thread/214906
I want like this, but I am not getting this expression completely.
I want to apply Aggr function only for B instead of both (A,B). Is it possible?
What does this statement means? Can you elaborate?
I just want to know that If we have two expression(separated by comma) in
single set analysis and If I want to apply aggr function only for one
expression, then Is it possible?
On Sun, Sep 3, 2017 at 12:34 AM, Sunny Talwar <qcwebmaster@qlikview.com>
Hi Vipin,
Please use the below expression
=Sum({$<A={'3'}>}Total)+Sum(Aggr(sum({$<B={'AP'}>}Total),dim))
Many Thanks
Karthik
Your response just don't make any sense... can you elaborate with an example?
Hi,
I am refraining my question in different way again:
I am using below expression:
=sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total)*(
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total))-
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Total)))
This expression is working fine. but If I use this expression with AGGR as
below, it is not giving me right data:
Sum(Aggr(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total)*(
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var2))'}>}Total))-
(sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Cost)/sum({$<A={'<=$(=$(Var1))'},Year={'$(=$(Var3))'}>}Total))),dim))
Can you please confirm if this syntax is fine
.
On Sun, Sep 3, 2017 at 10:58 PM, Sunny Talwar <qcwebmaster@qlikview.com>
if expression is working fine then why you are using Aggr?
Try this
1) Create a variable "vDIM" and put this exprecion:
if(GetSelectedCount(A) > 0, 'A') &
if(GetSelectedCount(A) > 0 and GetSelectedCount(B) > 0, ',') &
if(GetSelectedCount(B) > 0, 'B')
2) Put vDim variable into your expression Sum(Aggr(sum({$<A={'3'},B={'AP'}>}Total), $(vDIM)))