Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with weighted average

Hi,

I'm trying to script a set analysis using the calculation of weighted standard deviation as my base expression and ignoring the selection of Qtr Yr.

The calculation for wtd avg is:

sum([Yr Denominator Value]*[Yr Measure Value])/sum([Yr Denominator Value])

The yearly values are not calculated in qlikview itself  but is aggregated into tables in our ETL process.  So, I typically use ONLY  as the function when calling on those fields in set analysis.

I'm assuming the expression should look something like:

=ONLY({<[Qtr Yr]=>}sum([Yr Denominator Value]*[Yr Measure Value])/sum([Yr Denominator Value]))

but this is obviously not correct.  Any direction on how to tackle this would be greatly appreciated.

Thanks.

2 Replies
MK_QSL
MVP
MVP

May be

Avg(Aggr(sum([Yr Denominator Value]*[Yr Measure Value])/sum([Yr Denominator Value]),YourYearFIeld))

Not applicable
Author

Thank you, Manish.

Is there a way to also exclude selections for a certain field ( in my case )?