Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

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