Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: SUM BY GROUP

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


talk is cheap, supply exceeds demand
5 Replies

Re: SUM BY GROUP

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


talk is cheap, supply exceeds demand
Not applicable

Re: SUM BY GROUP

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.

Re: SUM BY GROUP

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

Re: SUM BY GROUP

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
Valued Contributor II

Re: SUM BY GROUP

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

Community Browser