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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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.

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
;