Hands on analysing Ecuador fiscal data with Alphacast
Hands on analysing Ecuador fiscal data with Alphacast
By Milagros Ricchini (mricchini@alphacast.io)
Read more Alphacast Highlights here
In this hands-on guide, we will show you how to use Alphacast Pipelines to automatize Latin American economies' analysis. In this case, we are going to make a graph of Ecuador's fiscal result and calculate its primary expenditure, which is not a variable of the dataset.
First, we look for the dataset which contains the variables we need: Fiscal - Ecuador - BCE - Non Financial Public Sector Operations.
The data excerpt in the overview of the dataset shows it contains multiple entities, this is useful information for the next steps in this guide, where we are going to transform the data using pipelines and create the graphs we need.
So, the next step is to transform de data by clicking on the right top button "Transform Data"
Now it's time for action!
As we saw the dataset has multiple entities, first we are going to filter the ones we are interested in, which are overall result, primary result, total expenditures and total revenue included into the entity "Totals":
When we click "Save & Preview Data" we can see the dataset we have now:
As the entities "Fist Level" and "Second Level" don't add information we are going to take them out by regrouping those entities, in this way the dataset will get easier to transform. Therefore, we add a new step, select "Regroup Entities" and proceed.
We only leave the entities we are interested in and in Grouping Function in this case it doesn't change anything because there will still be only one row of information for each date, we leave the one for default:
Once we get this clean dataset we can unstack it, so we have the variables as columns and make the variable calculations we need:
We look fot this step when we add a new one
And then we unstack the entity "Totals"
Now we have gotten a wide dataset with the variables we are interested in as columns, and we can calculate the primary expenditure as I said at the beginning by adding a new step and clicking
The difference between the primary and the overall result is the interests, so we are going to subtract those interests from the total expenditure and get the primary expenditure:
Now we have all the variables we wanted and can adjust them seasonally to then create the charts we wanted:
And then we create the charts with the variables we choose and can customize them as we desire:
You can check the full pipeline here, clone it, add steps and transformations and create and customize charts as you like!
In this case, Ecuador shows an important fiscal effort, mostly because total income has grown at a faster pace than primary expenditure, achieving a financial surplus in the last quarters of 2022.