Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with expression

I need some held with the expression for the Total Sales column

account_manager_idAcount_manager_nameSales_budgetR12 -Responsible AccountsYTD - Responsible AccountsR1 - Responsible AccountsTotal Sales
3Kim0319 753107 39191 436
50Stephan272 800438 740153 40934 181
57Jill150 00053 63345 4050
73Adam1 585 2001 535 223905 425181 183

In the Total Sales column i want to have the calculation

sum (sales) where account_manager_id from Staff_Table = sales_person_id in Sales_Table

The total sales shall include all sales from each account manager, doesn't matter if he/she is responsible for that account or not.

If someone please can help me code the expression that is needed.

5 Replies
Not applicable
Author

Hi Johan,

Can you post an example? Otherwise, perhaps this will work:

sum(if(account_manager_id = sales_person_id, sales))

Best,

Matt

Not applicable
Author

This is almost correct, the only thing is that it only shows me the total sales where the account manager is the same.

The correct amount in this example should be 6,3 million

Not applicable
Author

*bump*

tresesco
MVP
MVP

Had your  attachment been in English, would have been easier. Not sure if understood right. Try with set analysis p(),  like:

=sum({<account_manager_id = p(sales_person_id)>} sales)

Not applicable
Author

Hi Johan,

I'm still unclear on what you need. This makes sense to me and is solved with the sum/if expression:

sum (sales) where account_manager_id from Staff_Table = sales_person_id in Sales_Table.

However, I'm not sure how to interpret this:

The total sales shall include all sales from each account manager, doesn't matter if he/she is responsible for that account or not.


Could you elaborate? Perhaps include an excel showing how you calculate the 6.3 million or include a better explanation in the qvw.


Matt