Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for
Did you mean:
Not applicable

## How to do set analysis in this Aggr Sum expression

Hi Guys,

I am using following Expression in text box to show sum of total paid amount for orders.

=sum(Aggr([Paid Amount], OrderId,[Paid Amount]))

Where Can I add 'if' statement or set analysis in this expression to only see total amount where [Sales Rep] = 'James' ?

1 Solution

Accepted Solutions
Champion

May be this.

=sum(Aggr(If([Sales Rep] = 'James',[Paid Amount]), OrderId,[Paid Amount]))

Or

=sum(Aggr(Sum({<[Sales Rep] = {'James'}>}[Paid Amount]), OrderId,[Paid Amount]))

6 Replies
Creator II

try like this

aggr( sum({< [Sales Rep] = {'James'}  >}[Paid Amount])OrderId)

Not applicable
Author

Thanks Stephen, but did not work

Partner - Specialist

I don't think you need to use Aggr function for that.

The below should do -

sum({< [Sales Rep] = {'James'}  >}[Paid Amount])

Champion

May be this.

=sum(Aggr(If([Sales Rep] = 'James',[Paid Amount]), OrderId,[Paid Amount]))

Or

=sum(Aggr(Sum({<[Sales Rep] = {'James'}>}[Paid Amount]), OrderId,[Paid Amount]))

MVP

Not sure how and where you using this, but may be this (if what Naresh provided doesn't work for you)

=Sum({<[Sales Rep] = {'James'}>}Aggr(Only({<[Sales Rep] = {'James'}>}[Paid Amount]), OrderId,[Paid Amount]))

Not applicable
Author