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

SUM BY GROUP

Hi,

Like a count group by category:

Count({< HoraireName = {'Journée'} >} TOTAL <DateProd, ligne> PersonneID)

is it possible to do a SUM?

By exemple:

QlikView3.png

If a want to have the sum of HPrest for each HoraireName, Ligne and DateProd where HoraireName is not equal "Journée"

I try this but it didn't work:

SUM({< HoraireName = HoraireName-{'Journée'} >} TOTAL <DateProd, ligne> Surface)

1 Solution

Accepted Solutions
Gysbert_Wassenaar

try: SUM({< HoraireName -= {'Journée'} >} TOTAL <DateProd, ligne> Surface)


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

try: SUM({< HoraireName -= {'Journée'} >} TOTAL <DateProd, ligne> Surface)


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you for your answer but it didn’t work.

Here is the result of your solution.

I think it SUM all data from database but not only the displayed value.

Gysbert_Wassenaar

In your screenshot you can see that the sum is grouped by DateProd and ligne and that the sum for Journée is 0. As far as I can see the expression does what you asked. If it's not correct you need to explain more. It would help if you could share the qvw file you're working on.


talk is cheap, supply exceeds demand
Not applicable
Author

Your are right J

During the time I ask my question and your answer I renamed one column (the cause of the error).

Thank you’re a lot for your quickly help.

Pierre

chematos
Specialist II
Specialist II

Ttry this:

Aggr() function is like a group by, you need to specify the grouping fields after the sum()

aggr(sum({< HoraireName -= {'Journée'} >} HPrest),HoraireName, Ligne, DateProd)

Regards