Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to get weighted age per year in a straight table. I have tried a lot of ways but I do not get the weighted age per year (my dimension), only the total weighted age for my data. I hope that someone can help me to bring some light over my problem.
Dimension:
Year
Fields:
Age
WEIGHT
Sum(Total Age * Aggr(Sum(WEIGHT), Age)) / Sum(Total Aggr(Sum(WEIGHT), Age))
Thanks a lot in advance!
Best,
Sussi
Can you provide sample data and expected output
Hi
If Year is the chart dimension, you need to include it in the Aggr statements, something like:
Sum(Aggr(Age * Sum(WEIGHT), Age, Year)) / Sum(Total Aggr(Sum(WEIGHT), Age, Year))
The correct answer will depend on your data model so if this does not work, I suggest that you post a sample.
HTH
Jonathan