Initializing playground…
← Back to examples

🌐 Web Analytics Pivot Table

Scenario: A digital marketer has a stream of pageview events tagged with traffic source and device type. Pivot the data to see how each source performs across devices.

Skills: pivotTable, multiple aggregations, totals.

1 · Pivot pageviews by source × device

Sum pageviews into a 2-D table.

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

2 · Add row totals + bar chart of sources

Marketing wants the bottom line: total pageviews per source.

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