Announcements
cancel
Showing results for
Did you mean:
Partner - Creator

## if Condition with Set Analysis

Hi All

I Have a Simple Requirement , Where i Have a Product A and B ... My requirement is if sum of Product A is greater that B Than Count no of Branch,

Tab1:

Branch,Product,sale,Sale1

a,A,100,200

b,A,200,120

c,B,300,230

d,A,400,401

d,B,401,500

e,A,500,497

f,A,501,203

];

i am Using a Expression as in text object

=Count(if(sum({<Product={'A'}>}sale)>=sum({<Product={'A'}>}sale1),Branch))

But i am getting an error that nested Aggregation not Allowed..

Output should be 5.

As well i am attaching an qvw.

1 Solution

Accepted Solutions
MVP

In fact shouldn't it be just 3? Try this

=Count({<Branch = {"=Sum({<Product={'A'}>}sale) >= Sum({<Product={'A'}>}Sale1)"}>} Branch)

5 Replies
Employee

=Count(aggr(if(sum({<Product={'A'}>}sale)>=sum({<Product={'A'}>}sale1),

Branch),Branch))

MVP

Is the output 5 or 4?

=Count(Aggr(If(sum({<Product={'A'}>}sale)>=sum({<Product={'A'}>}Sale1), Branch), Branch)

Shouldn't it be just a, b, e, and f?

Anonymous
Not applicable

Change the order of your Expression

=if (sum({<Product={'A'}>}sale)>=sum({<Product={'A'}>}sale1), count(Branch))

MVP

In fact shouldn't it be just 3? Try this

=Count({<Branch = {"=Sum({<Product={'A'}>}sale) >= Sum({<Product={'A'}>}Sale1)"}>} Branch)

Employee

=Sum(Aggr(if(sum({<Product={'A'}>}sale)>=sum({<Product={'A'}>}sale1),1,0),Branch))