Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikofba
Contributor II
Contributor II

Weighted Average Total not working correctly

Hi,

The formula below calculates the weighted average of the interest rate.  Each row/line item matches up perfectly but my total row does not.  Is there a way to calculate a total of the weighted average?

sum({$<Month={'7'},Year={'2017'}>}([CD Balance]*[Interest Rate]))/Sum({$<Month={'7'},Year={'2017'}>}[CD Balance])

Thanks

3 Replies
swuehl
MVP
MVP

Can you tell us more about the context?

It's hard to tell what's wrong without knowing what you get using which input and what you expect to see instead.

sunny_talwar

Are you looking to sum the individual rows for your total? May be try this

Sum(Aggr(Sum({$<Month={'7'},Year={'2017'}>}([CD Balance]*[Interest Rate]))/Sum({$<Month={'7'},Year={'2017'}>}[CD Balance]), Dimension/s))

Replace the Dimension/s part with the list of dimensions from your chart

vkish16161
Creator III
Creator III

Try like this maybe.... more context needed.....


sum(TOTAL<Dimension> { $<Month={'7'},Year={'2017'}>}([CD Balance]*[Interest Rate]))/Sum({$<Month={'7'},Year={'2017'}>}[CD Balance])