bcgov / bcparks-ar-admin

BCParks Attendance and Revenue Admin
Apache License 2.0
4 stars 11 forks source link

A&R Variance report shows incorrect variance % #365

Closed manuji closed 1 week ago

manuji commented 3 weeks ago

Scenario:

Expected:

Example: 2017-2019 average for frontcountry camping at Bull Canyon Park was 779 people. 2022 attendance was 1,101 people.

(1,101-779)/1,101 = 0.29 0.29 x 100 = 29%

The 2022 attendance increased by 29% (or has a variance of 29%)`

Issue:

eg: Tested using Park: Test park, Sub area: Test sub area for the Month of February with the Activity is Boating activity. Check the Nights on dock field.

Value for Feb 2022: 600 Value for Feb 2023: 638 Value for Feb 2024: 1101

Expected Variance: 29% Variance on Exported report: 78% -> Incorrect

Check the video given below

https://github.com/user-attachments/assets/6c022755-aca1-4ff8-a752-fd1c4235c9ba

davidclaveau commented 3 weeks ago

Hey @manuji! I took a look at this but I think the calculation of 78% is correct for that Test Park.

Value for Feb 2022: 600 Value for Feb 2023: 638 Value for Feb 2024: 1101

Expected Variance: 29% Variance on Exported report: 78% -> Incorrect

Let me know if my logic below makes sense:

If you have an average for 2022 and 2023 of 619 ( (600 + 638) / 2 = 619), and then 2024 is 1101, then your variance would be calculated like so:

Similarly, say the 2022 and 2023 average were both 600. If we had 1200 in 2024 then you'd have an increase of 100% from the average.

So 1200 would be double the average of 600, or a 100% increase.

Let me know if that looks right and if my math checks out, but I believe that's how we're calculating the variances.

manuji commented 1 week ago

Acknowledged @davidclaveau , Thank you!