2020: Week 45 - Solution
Solution by Tom Prowse and you can download the workflow here.
This week we launched our new business: Prep Air. This is our airline that will fly between some of the world's major data hubs and other holiday destinations.
For the challenge this week we looked at the first quarters revenue and then try to determine what the rest of the year would have looked like if the world hadn't stopped.
Step 1 - Calculate Sales, Targets, & Variance
The first step this week is to combine the Ticket Sales & Sales Target tables. We can do this by joining the two together with the following join conditions:
We can then rename our value fields so that they match the correct values for Sales & Target. Then use both of these fields to calculate the Variance to Target:
[Sales Value]-[Target Value]
Our table should now look like this:
Step 2 - Clean Projections Table
We can then change the data type to a Whole Number, and we will have our field within a number format.
Next, we want to parse which quarter each of the projections belong to. We can extract the number by using an automatic split on the Pivot1 Names field, then using a string calculation to add the letter 'Q' before each of the numbers:
Quarter
'Q'+[Quarter]
Our projections table should now look like this:
Step 3 - Combine Airports
Step 4 - Calculation Projections
We are now ready to calculate the projected values based on the Q1 results. First, we need to calculate the total sales, target, & variance for Q1 for each of the different routes. To do this we use an aggregate tool with the following setup:
After we have aggregated so that we have a total for each route, we can now join this with our projections table. We want to join each of our projections (Q2-4) onto each of our Q1 rows based on the destination country:
We can then apply this calculation to each of our values:
Sales Value
[Sales Value]*[% Change]
Target Value
[Target Value]* [% Change]
Variance to Target
[Variance to Target]*[% Change]
Now we have projections for each of the future quarters, we need to combine with our values from Q1 by using a union to stack the values on top of each other. Our data now looks like this:
Step 5 - Calculate Yearly Totals
The full output can be downloaded here.