Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

philgood34
Contributor II

Average weight of a table

Hello,

I created this table

TABLE.png

totaux.png

Unfortunely, the average (22.85%) is not the weighted average as i looking for...

Do you know how do these weighted average ?

Thanks

1 Solution

Accepted Solutions
MVP
MVP

Re: Average weight of a table

Then try this

Sum(Aggr(Expression for % MARGE THEO * Expression for CAHT, SECTEURS))

14 Replies
MVP
MVP

Re: Average weight of a table

What is the number you are expecting to see?

philgood34
Contributor II

Re: Average weight of a table

I'am expecting (23.10%*3822831+15.4%*2875939+28.8%*680411+24.10%*1107559)/8486740 = 21.08%

MVP
MVP

Re: Average weight of a table

Then try this

Sum(Aggr(Expression for % MARGE THEO * Expression for CAHT, SECTEURS))

philgood34
Contributor II

Re: Average weight of a table

I understand your answer (thank's); but as a begginer i don't know where insert these instruction ? Indeed, the total line is automaticly created after the selection as shown :

totaux2.png

i can't write an fx ...

MVP
MVP

Re: Average weight of a table

What other options do you see here? Do you see Expression Default?

Capture.PNG

philgood34
Contributor II

Re: Average weight of a table

no

i see

auto

avg

count

max

min

sum

none

but not

expression fx

:-(

MVP
MVP

Re: Average weight of a table

Can you check with auto and this expression

Sum(Aggr(Expression for % MARGE THEO * Expression for CAHT, SECTEURS))

philgood34
Contributor II

Re: Average weight of a table

if i select auto i have no window to write the expression ???

totaux3.png

MVP
MVP

Re: Average weight of a table

Would you be able to share a sample qvf file?