0
votes

I try to get the total hours for a Employee

My Report should look like:

    GROUP "Month"        | Details 

Month | WorkHoursMonth | section | Hours         STATIC
----------------------------------------         --------------
      |                |   A1    |   12         
 1    |     50         |   B3    |   38         
----------------------------------------         
      |                |   A1    |   12         
 2    |     50         |   B3    |   38         
----------------------------------------         GROUP "Month"
      |                |   A1    |   12         
 3    |     62         |   B3    |   38         
      |                |   C1    |   12         
----------------------------------------         
 4    |     38         |   B3    |   38         
----------------------------------------         --------------
Total |    200                                   STATIC Total 

I tryed to use SUM() like SUM(Field.WorkHoursMonth.Value,"Month"). but i get an ERROR

Fehler 1 Der Value-Ausdruck für das Textfeld-Objekt 'SollStunden1' weist einen Bereichsparameter auf, der für eine Aggregatfunktion ungültig ist. Der Bereichsparameter muss auf eine Zeichenfolgenkonstante festgelegt sein, die einem der folgenden Werte entspricht: dem Namen einer enthaltenden Gruppe, dem Namen eines enthaltenden Datenbereichs oder dem Namen eines Datasets.


Update 1

The problem is my current Total is 424 instead of 200 but i don't know how to make a total at the end for the group which based on the error has to be inside the group.

    GROUP "Month"        | Details 

Month | WorkHoursMonth | section | Hours         STATIC
----------------------------------------         --------------
      |                |   A1    |   12         
 1    |     50         |   B3    |   38         
----------------------------------------         
      |                |   A1    |   12         
 2    |     50         |   B3    |   38         
----------------------------------------         GROUP "Month"
      |                |   A1    |   12         
 3    |     62         |   B3    |   38         
      |                |   C1    |   12         
----------------------------------------         
 4    |     38         |   B3    |   38         
----------------------------------------         --------------
Total |    424                                  STATIC Total 

Update 2

enter image description here

2

2 Answers

0
votes

First of all, I believe you might have made a typographical error:

I tryed to use SUM() like SUM(Field.WorkHoursMonth.Value,"Month"). but i get an ERROR

=SUM(Fields!WorkHoursMonth.Value,"Month")

But I doubt this is the cause of your issue, based on your error message. I believe you either didn't group correctly or your group just isn't called "Month".
You could try to remove the scope definition and simply use the following expression, just make sure it's still inside your group.

=SUM(Fields!WorkHoursMonth.Value)

Edit: I didn't realize that the WorkHoursMonth was the same for all rows and not being grouped on. Who knew this would cause so many issues for trying to calculate the total...

The grouping you have set up seems to be correct as long as the WorkHoursMonth value is the same for the entire month, which it seems to be in your case.

The following expression should then calculate your wanted total:

=Sum(Max(Fields!WorkHoursMonth.Value,"Month"))
0
votes

Just use [sum(month)] place this on your total