This document has been copied and moved somewhere else:

This document is intended to enable collaboration for both the header statistics’ api integrations and mathematical calculations.

NB: All queries are duplicated for the previous period using the previous start/end dates as params and renaming the as aliases with the prefix previous. Ex: spend as linearSpend & previousLinearSpend. For the sake of being concise, I’ll exclude the duplicity from the query column (although the actual graphql file has them).

NB: For the Delta Calculation column, if we apply the getDelta function, we are applying the following formula for percentage change:

This value is formatted with formatPercent to achieve the final, formatted percentage string.

If the denominator (previous value) is zero, we return null and do not show percentage change.

NB: The Title column is color coded based on whether or not we have consensus agreement the query and calculation is correct.

Red - the stat is probably not being queried/calculated correctly

Yellow - the stat is most likely being queried/calculated correctly, but not confirmed

Green - consensus agreement the stat is being queried and calculated correctly

NB: You will notice that some of the calculations include both streaming and linear stats. This is because the queries are conditional. For example, if we are only querying for linear stats, the streaming stats will be 0.