Grand total by unique employee id within group — Oracle Analytics

Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Grand total by unique employee id within group

Question
1
Views
0
Comments
CKleu
CKleu Rank 1 - Community Starter

Hi Gurus

This is my xml layout. My group is by <?for-each-group:row;./A.DEPTID?>. Now the employee id although unique can come up in multiple rows. Lets say as for example this employee 10021 comes up 10 times…. so maybe for row number 2 and row number 5 and row number 8, etc… etd… I need to sum up the H.AG_HOURS_AVAILABLE column throughout the xml for all employees but the H.AG_HOURS_AVAILABLE must only be selected once per employee. So as example although employee 10021 appears in 10 different rows across this xml it must only pick up the 188.6 once!

image.png

I cannot use <?sum(current-group()/H.AG_HOURS_AVAILABLE)?> as this will total for each row and the return the incorrect value.

The following is also to be noted my template starts with

<?for-each-group:row;./A.DEPTID?>

I also open up <?for-each-group:current-group();./A.EMPLID?>

I also open up <?for-each-group:current-group();./A.PROJECT_ID?>

I also open up <?for-each:current-group()?>

Then I close up <?end for-each-group?>

Then I close up <?end for-each-group?>

Then I close up <?end for-each-group?>

At this point I have closed up my grouping that was done by employee id… it is now only the grouping by Department that is still open. It is at this point that I want to build the sum of the available hours.

image.png

Any help would be appreciated.

Thanks

Chez

Tagged: