Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I hope you are doing well.
I have the following table:
Owner | MPG | MC | Change |
004 | AA | CP3 | 3 |
004 | AA | CP5 | 4 |
004 | AA | CP58 | 5 |
004 | AA | CP580 | 6 |
005 | 4J | SD25 | 5 |
005 | 4J | SD251 | 3 |
005 | 4J | SD252 | 9 |
005 | 4J | SD253 | 2 |
005 | 4J | SD254 | 7 |
Im trying find the avg of every MPG. so my resulting table would look something like this:
Owner | MPG | AVG(Change) |
004 | AA | 4.5 |
005 | 4J | 5.2 |
And i cannot get those numbers for the life of me. I am getting 5.58 for 4J. I have no other table in my app. Just that table.
Thank you.
this is what I get :
check if you have decimal values in Change like 5.002454... instead of 5 !
@waleeed_mahmood Looks like you have decimal numbers in your Change column. Rounding of Change column can help you to get the same number . Try below
= avg(floor(Change))
or
=avg(round(Change))
you can try the below code.
Test:
LOAD
Owner,
MPG,
MC,
Change
FROM [lib://dvSourceDataPath/ICO_Recharges_MI/Test/Book1.xlsx]
(ooxml, embedded labels, table is Sheet1);
Left Join (Test)
Test_Avg:
Load
Owner,
MPG,
Avg(Change) as ChangeAvg
Resident Test
Group By
Owner,
MPG,
;