Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
Can you help me with the following problem?
I want to show the sum of each field in the pivot table.
Unfortunataly it doesn’t work to sum the values for the following field:
„Therapiedauer in Stunden“.
Furthermore the sum for the following field is calculated wrongly:
„Therapiedauer in Stunden pro Woche“.
What can I do to get the correct sum for each field?
Many thanks in advance for your help!
Best regards,
Diana
Try these expressions.
1. Therapiedauer in Stunden :
Sum(Aggr(Sum(Therapieanzahl) * Therapiedauer_in_Stunden,[Patienten-ID],[KTL-Code]))
2. Therapiedauer in Stunden pro Woche:
Sum(aggr((Sum(Therapieanzahl)*Max(Therapiedauer_in_Stunden))/Max([Aufenthaltsdauer in Wochen]),[Patienten-ID],[KTL-Code]))
What is the expected result?
The excpected result for column "Therapiedauer in Stunden" is 36451,21; the sum of all values, when the pivot table is expanded.
The excpected result for column "Therapiedauer in Stunden pro Woche" is 11779,37; also the sum of all values, when the pivot table is extended.
I say "the sum when the pivot is extended", because there is also a problem with the totals for each "Patienten-ID" when the fields of the pivot-table are collapsed.
E. g. for Patienten-ID 100001 there is no shown (collapsed) value for column "Therapiedauer in Stunden" but it should be 34,92 and for column "Therapiedauer in Stunden pro Woche" the collapsed value is 33,38 but it should be 17,49.
Try these expressions.
1. Therapiedauer in Stunden :
Sum(Aggr(Sum(Therapieanzahl) * Therapiedauer_in_Stunden,[Patienten-ID],[KTL-Code]))
2. Therapiedauer in Stunden pro Woche:
Sum(aggr((Sum(Therapieanzahl)*Max(Therapiedauer_in_Stunden))/Max([Aufenthaltsdauer in Wochen]),[Patienten-ID],[KTL-Code]))
Thank you so much!
I have tried it with the aggregation before, but apparently I made a mistake somewhere.
This works perfectly!
Best regards,
Diana