Hi All,
I am trying to create a Graphical Calculation view on top an Analytical View. Out put of the Analytical view looks something like this,
| PERNR | Date of Birth | Org Unit | Count |
|---|---|---|---|
| 1 | 2/23/1980 | A | 1 |
| 2 | 2/23/1980 | A | 1 |
| 3 | 2/23/1970 | B | 1 |
| 4 | 2/23/1984 | B | 1 |
| 5 | 2/23/1985 | B | 1 |
In the Calculation view, I have created a Calculated Column in the projection node, named "Employee Age" with expression as 'daysbetween("Date of Birth", now())' and it is added to the output as Aggregated Column (SUM). Count is also added to the output as an aggregated column (SUM).
Another calculated column "Average Age" is created in the Aggregation node, with the expression as "Employee Age" / "Count". When I display the result of Calculation view, with PERNR in the output, Age and Average columns as the same data and is calculated properly. But when I have data displayed at Org Unit level, both the calculated columns "Employee Age" and "Average Age" columns display incorrect data.
| PERNR | Org Unit | Employee Age | Average Age | Count |
|---|---|---|---|---|
| 1 | A | 36 | 36 | 1 |
| 2 | A | 36 | 36 | 1 |
| 3 | B | 46 | 46 | 1 |
| 4 | B | 32 | 32 | 1 |
| 5 | B | 31 | 31 | 1 |
| Org Unit | Employee Age | Average Age | Count |
|---|---|---|---|
| A | 36 | 18 | 2 |
| B | 109 | 36.33 | 3 |
At the Org unit level, both the employees in Org Unit "A", has the same date of birth. So the calculated column is picking up only one row and calculating SUM of Age as "36" instead of "72" and Average Age as "18" instead of "36".
What should I do to get the output right, I mean how can I make the calculated column consider both the employees for calculation of SUM and AVG.
Any pointers on this, would be of great help. Please let me know, if the example I have given above is not clear.
Thanks & Regards,
Vishwa