Initializing playground…
← Back to examples

💰 Sales Dashboard

Scenario: You're an analyst at a regional retail chain. Q1 sales just landed in a CSV. Find top-performing regions and products, then visualize revenue with a quick ASCII bar chart.

Skills you'll use: readCsv, groupby().agg(), sortValues, nlargestDataFrame.

1 · Load the sales CSV

A typical first step: parse a CSV string into a DataFrame and inspect the schema.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2 · Compute revenue & rank regions

Add a derived revenue column, then group by region.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

3 · Top products & best single order

Use groupby + nlargestDataFrame to surface the headline numbers.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent