Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

jachopzon
New Contributor

Weighted age per year

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

Tags (2)
2 Replies
anbu1984
Honored Contributor III

Re: Weighted age per year

Can you provide sample data and expected output

MVP
MVP

Re: Weighted age per year

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser