Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Eston_Sello
Contributor III
Contributor III

Summing up values

Good day,

Please assist I am using the below formula to get the total sales by agent .

=sum(aggr(Total max([WF Sales]),Agent))

How do I sum up the results that I get from this formula because it works fine when I make a selection for one day but more than one day I get incorrect number.

 

Labels (1)
1 Solution

Accepted Solutions
Eston_Sello
Contributor III
Contributor III
Author

I have included day on my expression and it solved my problem.

=sum(aggr(max([WF Sales]),Day, Agent))

View solution in original post

11 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=sum( aggr( sum([WF Sales]), Agent ) )

I hope it can helps.

Eston_Sello
Contributor III
Contributor III
Author

Hi 

Thanks for the quick respond, sum gives me a very big number but max works fine but only for one day not for the whole month and I want to see sales made by agent for the whole month.

=sum(aggr(Max([WF Sales]),Agent))

agigliotti
Partner - Champion
Partner - Champion

your expression gives you the sum of maximum sales for each agent.
is this really what you need?
why are you talking about "only for one day" ?
are you using some filters?

Eston_Sello
Contributor III
Contributor III
Author

Yes i'm using date filters on the front end.

E.g

Sales for the 1st of March = 800
Sales for the 2nd of March = 650
And when I select the 1st and 2nd at the same time I get = 899 instead of  1450 that's why I say it works fine only for one day. 

agigliotti
Partner - Champion
Partner - Champion

could you share a sample app to look at?

Eston_Sello
Contributor III
Contributor III
Author

Please see the below.

Eston_Sello_0-1588859426164.png

 

Eston_Sello
Contributor III
Contributor III
Author

Someone advise me to do the below but I am not exactly sure how to do it.

''For this to work you would have to get max per day per agent and sum the result. Then aggregate the agents for a team leader''

agigliotti
Partner - Champion
Partner - Champion

it still not clear to me what you looking for.
could you attach a sample app with mock data?

Eston_Sello
Contributor III
Contributor III
Author

Please find the attached.