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 aggr problem

Hi,

I have a problem with aggr function.

My data looks like:

Date     Company          Value    

01.01.      A                    10

01.01       B                    15

01.01       C                    20

01.01     Total                   45

01.01.      A                    15

01.01       B                    5

01.01       C                    10

01.01     Total                    30

I have a dummy Company called Total and for each line I need to give aggregated sum per day.

However when i use the function: sum(aggr(sum(Value), Date) I get 0... (Putting that as a new expression next to Value shows that it gives the agregated value to only one line e.g. for company A.) How to make it working so that it gives me 45 for 01.01 for Total (and not by using pivot chart with subtotals, as I need to do other calculations for total in further columns)?

Thanks for hint.

Tom

1 Solution

Accepted Solutions
sunny_talwar

May be like this

If(Company = 'Total', Sum(TOTAL <Date> Value), Sum(Value))

View solution in original post

1 Reply
sunny_talwar

May be like this

If(Company = 'Total', Sum(TOTAL <Date> Value), Sum(Value))