Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Bobi
Partner - Contributor II
Partner - Contributor II

Weighted average.

Hi. I want to give different weight to salarys from two different companies. And calculate the average. However my expression doesnt work. 

 

I compare my salary levels (MySalaryLevels) with the market, and in the expression below it works fine with avg(MarketSalaryLevels).

Avg([MySalaryLevels])/avg([MarketSalaryLevels]

 

However when I try to get the weight by:

 

(Avg([MySalaryLevels])/avg (TOTAL <IPE,Country> [MarketSalaryLevels]*Weight) )

 

Then I dont get the expected value. I want the MarketSalaryLevels to get summed up like:

 

If marketcompany A: salary 50 000, weight: 50 %. Company B: Salary 40 000, weight 50 %. Then that avg expression should give 45 000.) Country and IPE are 2 dimensions that allways will be selected. Job function is a third dimension which also will be selected. (This column is hided until these are selected)

 

Any suggestions on how to correct the formula according to my expectations?

0 Replies