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: 
DSTaylor
Contributor II
Contributor II

Help with Sum (By Group?)

Hi,

I'm having an issue someone can hopefully assist with.

I have a table with the following fields:

Project Code,   Actual Hours,   Budgeted Hours

 

The total Budgeted Hours > total Actual Hours... however I need to figure out how to show in a text box the sum of Actual Hours > Budgeted Hours per Project Code.

So essentially across all Project Codes Budgeted Hours > Actual Hours.

There are a few Project Codes where Actual Hours > Budgeted Hours.

How can I just show these? I've tried 

sum(if(Actual>Budgeted, Actual) but of course this returns 0 until a Project Code with Actual > Budgeted is selected as otherwise it's calculating all and returning '-' as the total budgeted > actual across all codes.

 

I hope this makes sense,

Thanks!

1 Solution

Accepted Solutions
sumanta1234
Partner - Creator
Partner - Creator

Hi,

you can use the below code:

=IF(AGGR(SUM([Actual Hours]),[Project Code])>AGGR(SUM([Budgeted Hours]),[Project Code]),AGGR(SUM([Actual Hours]),[Project Code]))

But still you have to select the project code then only you can see actual value in text object. 

View solution in original post

1 Reply
sumanta1234
Partner - Creator
Partner - Creator

Hi,

you can use the below code:

=IF(AGGR(SUM([Actual Hours]),[Project Code])>AGGR(SUM([Budgeted Hours]),[Project Code]),AGGR(SUM([Actual Hours]),[Project Code]))

But still you have to select the project code then only you can see actual value in text object.