Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total organisational budgets not summed over ISO codes #647

Open
IsabelBirds opened this issue Feb 16, 2023 · 4 comments
Open

Total organisational budgets not summed over ISO codes #647

IsabelBirds opened this issue Feb 16, 2023 · 4 comments
Labels

Comments

@IsabelBirds
Copy link

Hi!

Where there are multiple annual budgets for the same ISO code in an org file - for example, to differentiate between budgets for the Syrian Arab Republic and North-west Syria - the total annual budget is only showing one budget, not their sum.

This org file contains two 2022 budgets, both under the SY recipient-country code:

Screenshot 2023-02-16 at 11 21 16

But the 2022 total only shows the value of the first budget:

image

Would it be possible to sum these to allow the org file to contain this level of detail without affecting the total budget?

Thanks!

@xriss
Copy link
Collaborator

xriss commented Feb 16, 2023

Can you tell me which publisher we are looking at here?

and I'll take a look at how things are calculated here, I would expect them to be added but maybe something else is happening.

@xriss
Copy link
Collaborator

xriss commented Feb 16, 2023

Ahh, it is not getting added, thinking back I can remember there being some discussion on this sort of thing and the conclusion was that the budgets as published in the org file should be one per country per year and an attempt to combine them might make things worse. So we just pick one for display.

Easy enough to change and I think it makes sense to do so. Just let me know what page you are looking at so I can do some before and after tests that it's doing the right thing there.

@IsabelBirds
Copy link
Author

Hi @xriss, thanks!

My example is from GAVI's data
http://d-portal.org/ctrack.html?reporting_ref=47122#view=countries&year=2021

@xriss
Copy link
Collaborator

xriss commented Mar 13, 2023

This is a dquery that shows which publishers / countries would be effected by this change sorted by size of change in USD.

http://d-portal.org/dquery/#%20%0ASELECT%20aid,budget_country,SUM(budget_usd_sum)-SUM(budget_usd_max)%20AS%20diff%20FROM(%0A%20%0A%20SELECT%0A%20%20%20%20aid,%0A%20%20%20%20budget_country,%0A%20%20%20%20budget_day_start,%0A%20%20%20%20SUM(budget_usd)%20AS%20budget_usd_sum,%0A%20%20%20%20MAX(budget_usd)%20AS%20budget_usd_max%0A%20%20%20%20%0AFROM%20budget%0A%0AWHERE%0A%20%20%20%20budget%20=%20'country'%0A%0AGROUP%20BY%0A%20%20%20%20aid,%0A%20%20%20%20budget_country,%0A%20%20%20%20budget_day_start%0A%0AORDER%20BY%0A%20%20%20%20aid,%0A%20%20%20%20budget_country,%0A%20%20%20%20budget_day_start%0A%20%20%20%20%0A)%20AS%20maxsum%0A%0AWHERE%0A%20%20%20%20budget_usd_sum!=budget_usd_max%0A%0AGROUP%20BY%0A%20%20%20%20aid,budget_country%0A%20%20%20%20%0AORDER%20BY%0A%20%20%20%203%20DESC

From this I found that US-GOV-1 reporting seems to involve double budgets for the same year with the same IATI status but with a different usg:type attribute. EG

<recipient-country-budget status="2" usg:type="Actual">
...
<recipient-country-budget status="2" usg:type="Appropriation">

Currently we are just picking one of these which seems to be more correct than adding them up.

So now I'm not sure if we should be making this change unless we talk to US-GOV-1 about this first.

Although it would fix it for you by a small amount it would double the number by a rather large amount in a lot of other cases. cc- @markbrough @stevieflow

@xriss xriss added the Data label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants