Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
avastani
Partner - Creator III
Partner - Creator III

Weighted Average in Script not as Expression

Has anyone been successful in calculating the weighted average at script level and not run time.

Labels (1)
2 Replies
prieper
Master II
Master II

Can you be a bit more specific?
One idea would be to build the averages and in a second table you build the weighting criteria and then merge both tables.

Peter

johnw
Champion III
Champion III

Example:

LOAD
SomeField
,sum(Price * Weight) / sum(Weight)
RESIDENT SomeTable
GROUP BY SomeField
;