Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
silvia_assuncao
Creator
Creator

Sum Total - Maybe with Aggregate

Hi All!

I have The total value within the lines are correct, but the total sum is wrong.

anyone know what change I need in the expression to have the right Total Sum?

My current expression is: Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8)))

6 Replies
sunny_talwar

May be this

Sum(Aggr(Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8))), Resource, [Project Name], [Business Area], Month))

Capture.PNG

sunny_talwar

Or this

If(Dimensionality() = 0, Sum(Aggr(Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8))), Resource, Month)), Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8))))

Capture.PNG

silvia_assuncao
Creator
Creator
Author

Last one:

There is a conditional before and then the subtraction:

if(Sum([Hours Resource])/
Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8)))
<=.99,

Sum(Aggr(Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8)))
-
Sum([Hours Resource]),Resource,Month, [Resources Location])))

silvia_assuncao
Creator
Creator
Author

What can I do to show the totals?

sunny_talwar

May be this

Sum(Aggr(if(Sum([Hours Resource])/

Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8)))

<=.99,

Sum(Aggr(Sum(DISTINCT(if(Month=Month_Working_Days,Working_Days_Qt*8)))

-Sum([Hours Resource]),Resource,Month, [Resources Location]))),Resource,Month, [Resources Location]))

silvia_assuncao
Creator
Creator
Author

Totally worked! thanks a lot!