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

Aggregate Percentage

Hi,

I am trying to show the percentage of a field with three distinctions.

Company Division=sum(sales)Total Company Sales
AA11055
AA22055
AA32555

At the moment when I calculate the total using the expression  =aggr(sum(Sales),Company) , I am only getting the total company sales for one division.

How can I get it for all?? So I can then work out the percentage sales as a total?

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

You should not use Aggr() for this. You should use the total qualifier:

The total sales, entire selection: Sum( total sales )

The total sales, within company: Sum( total <Company> sales )

So your percentage should be calculated through

     Sum( sales ) / Sum( total <Company> sales )

HIC

View solution in original post

5 Replies
Not applicable
Author

hi

try this

aggr(sum(Total Sales),Company)

hic
Former Employee
Former Employee

You should not use Aggr() for this. You should use the total qualifier:

The total sales, entire selection: Sum( total sales )

The total sales, within company: Sum( total <Company> sales )

So your percentage should be calculated through

     Sum( sales ) / Sum( total <Company> sales )

HIC

Not applicable
Author

hi

try this

sum(Sales)/SUM(TOTAL {1} Sales)

Not applicable
Author

Great Thanks, Working now

hic
Former Employee
Former Employee