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: 
Not applicable

Weighted calculation

Hey @all

I am looking for a way to bring this calculation to a QlikView expression:

(

  [value1_month1] * [value2_month1] +

  [value1_month2] * [value2_month2] +

  [value1_month3] * [value2_month3]

) / (

  [value1_month1] + [value1_month2] + [value1_month3]

)

This is just an example.

The result should be reacting on the selection of the month.

So if you select March, April, June and July this 4 should be used in the calculation.

I have made a few tries with the aggr() function before but have not a working result yet.

Are there any possibilities instead of using a fixed number of months?

Thank you for your help.

S.Koenen

1 Reply
hic
Former Employee
Former Employee

So you weight your "value2" with a "value1". Then a straightforward


     Sum([value1] * [value2]) / Sum( [value1] )

should do the trick.

HIC