Weighted calculation

I need help with a weighted calculation.

I’m trying to calculate a weighted Precision for all rules.

Precision: Fraud / Accept
Weighted Precision: (Fraud / Accept) * (Incoming Rule / Incoming Total)

I have no problem with the calculation by each Rule but the total is where I’m having problems. It’s a little bit misleading because the actual precision would depend on the Incoming and not the Accept.

I was able to perform the calculation that I want row by row but then when I want to check it as a total it performs the calculation at an aggregate level instead of summing each row. How can I fix that?

Very much appreciated.

image

Hi
Please look in this might be helpful for you.
Weighted Average Between Multiple Values - Question & Answer - Amazon QuickSight Community

Hi @fmassa95 ,

Welcome to the QuickSight Community!!

To understand this better, can you share the formula you are using? Or you can share sample data over Arena to check.

From what I could understand was when you are calculating at row level the calculation works, however the total does not. So you may need to consider using level aware calculation that calculates the weighted precision at Rule level and you can further aggregate it based on your requirement to fetch totals.

Thanks,
Prantika

Hello Prantika, thank you for your help.
Trying to share [here](Test Weighted Precision) the Arena but no sure if I’m doing it in the correct way.

I’ve never used level aware calculation but it seems like it would be the best way to do it. Would appreciate any help :slight_smile:

Have few more question here to understand the data:
the first snippet shows the total values for Accept as 35 instead of 45(sum of fraud across each rule). which one is the intended value? Same for the Fraud shows 21 instead of 22.

This most probably will answer how you arrive at 14.38%, since for incoming the total is a direct sum.

1 Like

I’m sorry, the print was wrong. This would be the correct one.
image

But the problem still persists and it’s that I dont know how I can create a calculation at row level (Precision * Share) that then it will sum the results of each row instead of performing the calculation at an aggregate level.

Please check this: 31276 - sample solution

Have tried to follow similar breakdown as you used in the sample data.

1 Like

Thank you so much Prantika. I was able to reach the desired results with that sample!

1 Like