Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Weighted Average by sub-dimension Straight table

This is probably an easy solution for you guys, but I have been struggling with it past 3 hours.

I scanned the community and there are many questions on weighted average but I cant seem to figure out my issue. Hopefully it is easy.

Current weighted Average formula for EGG_AGE:

Sum(Total EGG_AGE * Aggr(Sum(EGGS_SET), EGG_AGE)) / Sum(Total Aggr(Sum(EGGS_SET),EGG_AGE))

Works perfectly if I select a LOCATION_FROM (picture 1). However in a straight table with multiple LOCATION_FROM. It is a fixed value (See picture 2.)

The weighted EGG_AGE is based on the unique combination of EGG_SET by HATCH_ID (see picture 3).

I tried adding LOCATION_FROM, or HATCH_ID in the AGGR function but none of them seemed to work correctly.