Skip to content
Datablare
Claude Code Banking Revenue & growth

Card spending mix and portfolio

4,184 active cards with a ₹405 average ticket; Travel leads spend and 33% of transactions are online.

Data
Synthetic retail bank demo data (PostgreSQL)
Asked in
Claude Code
Updated
Try this on your data

1 · The brief

What Claude Code was asked

How are customers using their cards this year? Show active cards, average ticket size, the credit share of spend and the online share, spend by merchant category, spend by card brand and type, the channel mix, and average ticket by customer segment.

Given exactly like this. Claude Code asked Datablare which tables it could read, wrote the SQL itself, ran each query through Datablare and built the dashboard from what came back.

2 · The dashboard

The dashboard Claude Code built

Card spending mix and portfolio dashboard: Spend by merchant category, Transactions by channel, Spend by card brand and type, Average ticket by segment

Built from 5 read-only queries. Every figure on the dashboard was read from the database through Datablare; nothing was estimated or typed in.

Headline numbers (January–October 2026):

  • Active cards: 4,184 (Used in 2026)
  • Average ticket: ₹405 (Approved transactions)
  • Credit share of spend: 33.5% (Value on credit cards)
  • Online share: 33.4% (Of approved transactions)

What stands out:

  • Spend by merchant category: Travel and Electronics take the most value
  • Transactions by channel: Online and POS lead
  • Spend by card brand and type: Debit carries most of the spend on every brand
  • Average ticket by segment: Retail customers spend ₹411 a transaction

The data is a synthetic retail bank dataset made for this example, so the numbers describe no real company. The queries, the dashboard and the audit entries are real: Claude reached the database only through Datablare, read-only, and every query is on record with the question it served.

3 · What Datablare ran

5 read-only queries, nothing changed

Each query below is copied from the audit log of this run. Datablare checked that it only reads, ran it read-only, and gave only the rows to Claude Code; it never stores them.

  1. Query 1

    Active cards, average ticket, credit share of value and online share of transactions, 2026

    1 row · 89 ms

    SELECT count(DISTINCT t.card_id) AS active_cards, round(avg(t.amount), 0) AS avg_ticket,
           round(sum(t.amount) FILTER (WHERE c.card_type = 'Credit') / sum(t.amount), 4) AS credit_share_of_value,
           round(avg(CASE WHEN t.channel = 'Online' THEN 1.0 ELSE 0 END), 4) AS online_share
    FROM banking.transactions t
    JOIN banking.cards c ON c.id = t.card_id
    WHERE t.ts >= TIMESTAMP '2026-01-01' AND t.status = 'approved'
  2. Query 2

    Approved spend by merchant category, 2026

    9 rows · 76 ms

    SELECT merchant_category, round(sum(amount), 0) AS value, count(*) AS transactions
    FROM banking.transactions
    WHERE ts >= TIMESTAMP '2026-01-01' AND status = 'approved'
    GROUP BY 1
    ORDER BY 2 DESC
  3. Query 3

    Approved spend by card brand and card type, 2026

    8 rows · 111 ms

    SELECT c.brand, c.card_type, round(sum(t.amount), 0) AS value
    FROM banking.transactions t
    JOIN banking.cards c ON c.id = t.card_id
    WHERE t.ts >= TIMESTAMP '2026-01-01' AND t.status = 'approved'
    GROUP BY 1, 2
    ORDER BY 1, 2
  4. Query 4

    Transactions by channel, 2026

    4 rows · 75 ms

    SELECT channel, count(*) AS transactions
    FROM banking.transactions
    WHERE ts >= TIMESTAMP '2026-01-01'
    GROUP BY 1
    ORDER BY 2 DESC
  5. Query 5

    Average approved ticket by customer segment, 2026

    3 rows · 98 ms

    SELECT cu.segment, round(avg(t.amount), 0) AS avg_ticket, count(*) AS transactions
    FROM banking.transactions t
    JOIN banking.cards c ON c.id = t.card_id
    JOIN banking.customers cu ON cu.id = c.customer_id
    WHERE t.ts >= TIMESTAMP '2026-01-01' AND t.status = 'approved'
    GROUP BY 1
    ORDER BY 2 DESC
Tables read banking.cardsbanking.customersbanking.transactions

4 · The audit entry

Who asked what, on record

Every query is recorded with the person who asked, the question in their words and why the agent ran it. Admins see this in the audit log; nothing reaches the database without it.

How the audit log works

query_data_source

via Claude Code

Allowed
Who
The person signed in (hidden on this public page)
Question
How are customers using their cards this year? Show active cards, average ticket size, the credit share of spend and the online share, spend by merchant category, spend by card brand and type, the channel mix, and average ticket by customer segment.
Intent
Active cards, average ticket, credit share of value and online share of transactions, 2026
Result
5 queries, 25 rows, read-only

More use cases

All examples
  • Customer activity by city and segment dashboard: Active customers per month, Approved value by city, 2026, Spend per active customer per month, Customers by city and risk level
    Claude Code Banking Customer analytics

    Customer activity by city and segment

    2,277 of 3,000 customers active this year, spend per active customer each month, value by city, and the risk mix in each city.

    Updated Open

  • Card transaction risk monitor dashboard: Transaction value per month, Failed rate by customer risk level, Failed rate by merchant category, Monthly failed rate
    Claude Code Banking Risk & compliance

    Card transaction risk monitor

    41,022 card transactions worth ₹16.73M, a 2.46% failure rate, and where failures concentrate by risk level and merchant.

    Updated Open

  • E-commerce sales and retention dashboard dashboard: Monthly revenue, Revenue by category, 2026, Lifetime revenue per customer, by channel, Orders per month
    Claude Code E-commerce Executive overview

    E-commerce sales and retention dashboard

    ₹5.21M revenue from 11,897 orders this year, a 57.9% repeat-customer rate, and which channels bring the customers who spend most.

    Updated Open

Build this on your own data.

Connect your database, choose the tables Claude may read, and give it the same brief. Claude is connected in about two minutes.

30 minutes with the founder. Or WhatsApp / [email protected]