Sign Up

Sandbox Mode — Try Thoriad without signing up. Real code execution with DLP scanning and audit logging.

Markdown

Q4 Revenue Analysis

Overview

This notebook analyses Q4 revenue performance across all regions, with a focus on:

  • Revenue growth by segment
  • Top-performing accounts
  • Regional comparisons and YoY trends
Data sourced from q4_revenue.xlsx and customers.csv via the internal data lake.
Python
[1]
1import pandas as pd
2import numpy as np
3
4# Load Q4 revenue data
5df = pd.DataFrame({
6 'region': ['Americas', 'EMEA', 'APAC', 'LATAM'],
7 'revenue': [142.3, 98.7, 76.4, 34.2],
8 'growth': [18.2, 12.5, 24.1, 8.7],
9 'accounts': [3420, 2180, 1650, 890]
10})
11
12print(df.to_string(index=False))
13print(f"\nTotal revenue: ${df['revenue'].sum():.1f}M")
regionrevenuegrowthaccounts
Americas142.318.23420
EMEA98.712.52180
APAC76.424.11650
LATAM34.28.7890
Python
[2]
1import matplotlib.pyplot as plt
2
3regions = ['Americas', 'EMEA', 'APAC', 'LATAM']
4revenue = [142.3, 98.7, 76.4, 34.2]
5
6plt.figure(figsize=(8, 4))
7plt.bar(regions, revenue, color='#D4714E')
8plt.title('Q4 Revenue by Region ($M)')
9plt.ylabel('Revenue ($M)')
10plt.tight_layout()
11plt.show()

Q4 Revenue by Region ($M)

$142.3MAmericas$98.7MEMEA$76.4MAPAC$34.2MLATAM
AI
Cmd+Enter to generate

Thoriad AI

Based on the data, APAC shows the highest growth potential. With 24.1% growth and a revenue-per-account ratio of $46.3K (vs Americas at $41.6K), APAC combines strong momentum with efficient account economics. Here's code to calculate the full breakdown:

# Revenue efficiency analysis
df['rev_per_account'] = (df['revenue'] * 1e6 / df['accounts']).round(0)
df['growth_score'] = df['growth'] * df['rev_per_account'] / 1000

result = df.sort_values('growth_score', ascending=False)
print(result[['region', 'rev_per_account', 'growth', 'growth_score']])
Python
[3]
1# Attempting to use undefined variable
2total = revenue_data.sum()
3print(f"Grand total: {total}")

NameError: name 'revenue_data' is not defined

Traceback (most recent call last)
File "<cell>", line 2, in <module>
    total = revenue_data.sum()
SQL
[ ]
1SELECT
2 r.region_name,
3 SUM(t.amount) AS total_revenue,
4 COUNT(DISTINCT t.customer_id) AS customers,
5 ROUND(AVG(t.amount), 2) AS avg_deal_size
6FROM transactions t
7JOIN regions r ON t.region_id = r.id
8WHERE t.quarter = 'Q4'
9GROUP BY r.region_name
10ORDER BY total_revenue DESC
11LIMIT 10
JavaScript
[4]
1const report = {
2 summary: { totalRevenue: 351.6, avgGrowth: 15.9, topRegion: "APAC" },
3 regions: [
4 { name: "Americas", revenue: 142.3, growth: 18.2, accounts: 3420 },
5 { name: "EMEA", revenue: 98.7, growth: 12.5, accounts: 2180 },
6 { name: "APAC", revenue: 76.4, growth: 24.1, accounts: 1650 },
7 { name: "LATAM", revenue: 34.2, growth: 8.7, accounts: 890 },
8 ],
9 metadata: { quarter: "Q4", year: 2025, currency: "USD" }
10}
11
12console.log(JSON.stringify(report, null, 2))
Q4 Report Object
{
"summary": {
"totalRevenue": 351.6,
"avgGrowth": 15.9,
"topRegion": "APAC"
}
,
"regions": [
{ 4 keys }
,
{ 4 keys }
,
{ 4 keys }
,
{ 4 keys }
]
,
"metadata": {
"quarter": "Q4",
"year": 2025,
"currency": "USD"
}
}
Python
[ ]
1# Sending data to external API
2import requests
3
4api_key = "sk-proj-abc123def456ghi789jkl012mno345"
5response = requests.post(
6 "https://api.openai.com/v1/completions",
7 headers={"Authorization": f"Bearer {api_key}"},
8 json={"model": "gpt-4", "prompt": "Hello"}
9)
10print(response.json())

Run a cell to see audit events appear here.

Like what you see?

Get unlimited executions, multiple languages, real-time collaboration, and full governance features.