Track and grow your ARR →
Unlock CFO-grade clarity into your SaaS metrics with Equals.
Bobby’s original script for building out ARR at Intercom was thousands of lines of Python.
Here’s how that script calculated expansion. It would sort customers’ charges by billing number, calculate the difference between the periods, and return the delta or the expansion amount.
charges['expansionMRR'] = 0
charges['billingNum'] = 0
for x in set(charges['stripe_customer_id']):
temp = charges[charges['stripe_customer_id'] == x]
temp = temp.sort(['created_at'], ascending=[1])
for y in range(len(temp)):
charges.ix[temp.index[y], 'billingNum'] = (y + 1)
if y != 0:
charges.ix[temp.index[y], 'expansionMRR'] = (
temp.ix[temp.index[y], 'mrr_amount']
- temp.ix[temp.index[y-1], 'mrr_amount']
)
expansionMRR = charges[['unixMonth', 'expansionMRR']].groupby('unixMonth').sum().reset_index()
expansionMRR = expansionMRR.sort('unixMonth')
This ultimately turned into a multi-thousand-line Python script that pieced various pricing models together. It accounted—pretty horrifically and manually—for all the ways in which somebody could pay us (monthly, quarterly, annually) using all the different methods.
In some ways, it was a pure miracle that this worked, and we were able to keep it all together. The script was brittle, though. It’d break anytime we changed something about our business. Worst of all, nobody could use it but Bobby, meaning nobody else could do ARR analysis—which became a major problem as we scaled.
The most intimidating part was not knowing how to turn this Python script and its output into something that would scale. For Bobby, the Finance team, and everyone else that would ultimately need to report in some way on ARR.
We ultimately settled on the following format—the table we outline in this chapter. It was a complete game changer in how we and the rest of the company accessed ARR reporting.
Now it’s time to turn all the logic you’ve defined into a source of truth. This exercise aims to create a set of tables that you and your team can use to report on ARR easily and efficiently. All of your logic will be applied in various SQL queries.
As you get stuck into this, here are three principles to remember:
First, we’ll outline the process and pieces you’ll put together as part of this exercise. If this isn’t quite obvious or intuitive at first, don’t worry. We’ll walk through each table in more detail and show examples to help illustrate.
Here’s how it looks at a surface level:
Let’s dig into each table in more detail.
Next topic