Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelataides
Contributor III
Contributor III

Média Ponderada

Boa tarde Pessoal,

     Eu tenho duas colunas sendo as duas, médias de outras colunas.

     Eu preciso ponderar essas duas colunas para criar um terceiro índice.

     Ex.: Média Saque dia e Reais por Saque.

     A média deverá trazer pra mim um Saque ponderado.

     Abaixo segue planilha de exemplo.

REGIONALFILIALSaqueReaisMédia Saque diaReais por SaqueSaque Ponderado
Regional 1110832163,7229,78?
29627363,3128,5?
3164180,5526,13?
4256500,8626?
54210681,4525,43?
6399121,3423,38?
7194000,6621,05?
Total 345940011,927,25?
Regional 28259100,8636,4?
99730963,3431,92?
107422602,5530,54?
115015201,7230,4?
1229824128,41?
13318221,0726,52?
144912641,6925,8?
15379141,2824,7?
1611127003,8324,32?
174410261,5223,32?
189722323,3423,01?
197716222,6621,06?
206212522,1420,19?
Total 783204422726,11?
Regional 321125600,4146,67?
224114161,4134,54?
23196500,6634,21?
24184740,6226,33?
25164060,5525,38?
264410781,5224,5?
27194360,6622,95?
287916702,7221,14?
2913826784,7619,41?
306813142,3419,32?
31426801,4516,19?
32172620,5915,41?
33253840,8615,36?
Total 5381200818,5522,32?
Regional 43492340,3126?
35317261,0723,42?
367917822,7222,56?
379317043,2118,32?
38528761,7916,85?
394640,1416?
40304301,0314,33?
416760,2112,67?
423380,112,67?
Total 307593010,5919,32?
Regional 543185260,6229,22?
447815282,6919,59?
45407181,3817,95?
46193140,6616,53?
47223020,7613,73?
48121620,4113,5?
Total 18935506,5218,78?
Regional 649124380,4136,5?
50143780,4827?
519221583,1723,46?
52408661,3821,65?
53438741,4820,33?
54468801,5919,13?
55162680,5516,75?
5658964216,62?
576900,2115?
58304421,0314,73?
599814203,3814,49?
60455821,5512,93?
61101140,3411,4?
627600,248,57?
Total 517953417,8318,44?
Regional 763328261,125,81?
64328081,125,25?
6510520103,6219,14?
66468641,5918,78?
67356501,2118,57?
68111500,3813,64?
69233100,7913,48?
704360,149?
7126622569,178,48?
Total 554791019,114,28?
Regional 872379081,2824,54?
73255240,8620,96?
746912542,3818,17?
7529516117,79?
76142460,4817,57?
77223440,7615,64?
78243620,8315,08?
79446561,5214,91?
80567261,9312,96?
81687887423,6912,92?
82445461,5212,41?
83415021,4112,24?
84364181,2411,61?
85403821,389,55?
Total 11681625840,2813,92?
Total 440185032151,7619,32?
2 Replies
Clever_Anjos
Employee
Employee

Michael,

Uma média ponderada sempre tem um "relação a que", que é justamente o fator de ponderação.

Qual seria o seu fator de ponderação?

A fórmula básica de uma média ponderada é:

Sum( X * P) / Sum(P) onde P é o fator de ponderação

girino777
Creator III
Creator III

Olá Michael.

Tive o  mesmo problema para achar a média ponderada. 

Resolvi fazendo o calculo durante a carga.

Ou seja, no seu exemplo ficaria assim:

Saque x Reais por Saque         as VALOR

Dai no QLIKVIEW, o valor que der acima você divide pela soma do Saque.

SUM(VALOR) / SUM(SAQUE)

Tenta assim e depois retorna.

No meu caso funcionou...!!  

abraço.

Renato