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: 
Not applicable

Sum of values in a field, across entire sheet, regardless of selection

I want to find unique rows of ProjectName and sum the values under Budget.

ProjectNameBudget
1123
1123
2456
2456
3789
4101112
4101112
5131415
6161718
742

sum(aggr(sum(DISTINCT Budget), ProjectName))

^ would that work?

And how do I modify the code to make it sum, regardless of what rows are selected?

1 Solution

Accepted Solutions
MayilVahanan

Hi,

     Try like this

=Sum({1}Distinct Budget) or Sum({1}Budgets)

-Regardless of dimension

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

5 Replies
MayilVahanan

Hi,

     Use ProjectName as Dimension and use expression like this

     sum(aggr(sum(DISTINCT Budget), ProjectName))
    

or

Test:

LOAD * Inline [

ProductName,Budget

x,4

x,4

y,5

y,5

];

Data2:

LOAD ProductName, Sum(DISTINCT Budget) as Budgets Resident Test Group By ProductName;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks!  I'm using it in a Text object and I want to report the entire sheet's sum, regardless of selection.  How is this done?

MayilVahanan

Hi,

Test:

LOAD * Inline [

ProductName,Budget

x,4

x,4

y,5

y,5

];

Data2:

LOAD ProductName, Sum(DISTINCT Budget) as Budgets Resident Test Group By ProductName;

(or)

In text box,

use like this

=Sum(Distinct Budget) or Sum(Budgets)

itself give all distinct value in textbox. when you select dimension, values changes according to your selection.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Mayil Vahanan Ramasamy wrote:

when you select dimension, values changes according to your selection.

Hope it helps

Yes, but I want the value to stay the same, regardless of selection.  I'm reporting the total, for the entire sheet.

Thank you.

MayilVahanan

Hi,

     Try like this

=Sum({1}Distinct Budget) or Sum({1}Budgets)

-Regardless of dimension

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.