Multi-panel build Β· Variables Β· Assignment 3 guidance
| Time | Segment | Activity |
|---|---|---|
| 0β10 min | Setup Check | Open the Lecture 14 Transaction Risk dashboard |
| 10β20 min | Design Principles | What makes a dashboard useful vs pretty |
| 20β55 min | Lab Part 1 | Extend the transaction dashboard to five panels |
| 55β70 min | Lab Part 2 | Add a city variable and update panel queries |
| 70β75 min | Interpretation | Turn dashboard evidence into a management action |
| 75β85 min | Design Review | Student dashboards β what works, what doesn't |
| 85β90 min | A3 Guidance | Assignment 3 requirements and tips |
The most common mistake: Building a dashboard that answers "What data do I have?" β instead of "What decision does this dashboard support?"
Set the dashboard time range to 1 Augustβ31 August 2025 so the Daily Transaction Volume panel includes the imported historical records.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Fraud Operations [City: All βΌ] β βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ€ β Flagged Rate β Flagged Transaction Value β β (Stat) β (Stat) β βββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ€ β Daily Transaction Volume (Time Series) β βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ€ β Flagged by Merchant β Highest-Value Flagged β β (Bar Chart) β Transactions (Table) β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Keep the fraud-rate Stat and review-queue Table from Lecture 14. Add the three panels below, then arrange all five into the target layout.
SELECT SUM(amount) AS value FROM transactions WHERE is_fraud = 'true';
Settings: Visualisation = Stat | Unit = Indian Rupee | Decimals = 0 | Colour = red
SELECT $__timeGroupAlias(`timestamp`, '1d'), COUNT(*) AS value FROM transactions WHERE $__timeFilter(`timestamp`) GROUP BY 1 ORDER BY 1;
Settings: Visualisation = Time Series | Unit = count | Line width = 2 | Fill opacity = 10
SELECT merchant, COUNT(*) AS value FROM transactions WHERE is_fraud = 'true' GROUP BY merchant ORDER BY value DESC LIMIT 10;
Settings: Visualisation = Bar Chart | Category = merchant | Value = count | Orientation = horizontal
Reuse the Lecture 14 Stat query. Keep thresholds at green below 3%, amber from 3%, and red from 5%.
Reuse the Lecture 14 Table query, sorted by converted amount descending and limited to 20 rows.
Discussion: A merchant with many flagged transactions is not automatically fraudulent. It may simply have high transaction volume. A manager should request a fraud-rate comparison before blocking the merchant.
Variables make one dashboard reusable across locations instead of creating a separate dashboard for every city.
city | Type: Custom | Values: Mumbai, Delhi, Bengaluru, Hyderabad, Chennai, Kolkata, Pune, Ahmedabad.*.AND city REGEXP '^${city:raw}$' to queries that already have a WHERE clause.WHERE city REGEXP '^${city:raw}$' before GROUP BY.The dropdown now filters all panels simultaneously. Selecting All uses the .* regular expression and keeps every city.
The dashboard above analyses a completed historical dataset. To watch it change while Kafka is running, use the isolated Lecture 16 Extension files and database. One consumer writes every transaction to sda_course_l16.transactions; the other writes flagged events to sda_course_l16.fraud_alerts.
transaction_producer_16.py
|
v
transactions-topic-l16
| |
v v
consumer_store_ consumer_alerts_
mysql_16.py mysql_16.py
| |
v v
transactions fraud_alerts
\ /
v v
Grafana
ingested_at for live transaction panels, not the simulated timestamp.detected_at for the live alert queue.SELECT $__timeGroupAlias(ingested_at, '5s'), COUNT(*) AS value FROM transactions WHERE $__timeFilter(ingested_at) GROUP BY 1 ORDER BY 1;
Continue with the complete build: Lecture 16 Extension β Kafka to MySQL to a Real-Time Fraud Dashboard clubs the producer, both consumers, database tables, live queries, and dashboard configuration into one guided lab.
Use the completed dashboard to prepare a 60-second fraud-operations briefing:
For each dashboard, evaluate:
| Question | What to Look For |
|---|---|
| Does it answer a clear business question? | "Who is the user? What decision are they making?" β one sentence |
| Is colour usage consistent? | Red = alert/bad, Green = normal. No decorative red on neutral data. |
| Is the refresh rate appropriate? | 30s is fine for demos; 5s for live risk monitoring |
| Are axes labelled with units? | Always: βΉ, count, %, minutes β never raw numbers without context |
| Is the time range visible? | Users should always know what window of data they are looking at |
Due: 1 October | 15 marks
Create a dashboard for the analysis of your consumed data (the domain from A1, streamed in A2).
| Requirement | Detail |
|---|---|
| Minimum 4 panels | At least 1 time series, 1 stat/KPI, 1 table |
| Real data | Connected to the course MySQL transaction dataset or another supported datasource |
| 1 variable/filter | Makes the dashboard interactive |
| Colour thresholds | Reflect actual business logic β not default colours |
| Explanation | 200-word write-up: what business question each panel answers |
Submission: Export dashboard JSON (Dashboard β Share β Export JSON) + screenshots. Upload to GitHub with tag [A3][SDA-1], [A3][SDA-2], or [A3][SDA-G].
Quality signal: Write this before building: "As a [role] at [company type], I want to see [metric] so that I can [decision]." Students who write this user story first consistently produce better dashboards.
Configure Grafana alert rules and routing, then run the optional end-to-end extension to watch Kafka transactions and fraud alerts appear in MySQL and Grafana in real time.