PayPal monthly summary SQL

SELECT 
    substr(Date, 7, 4) || '-' || substr(Date, 1, 2) AS month,
    SUM(gross) AS total_gross,
    SUM(fee) AS total_fee
FROM "PayPal_2024_01_01-2024_12_31_"
WHERE Type = 'Subscription Payment'
GROUP BY month
ORDER BY month;

Stripe monthly summary SQL

SELECT 
    strftime('%Y-%m', created_utc) AS month,
    SUM(CASE WHEN gross < 0 THEN gross ELSE 0 END) AS total_recurring_fee,
    SUM(CASE WHEN gross > 0 THEN gross ELSE 0 END) AS total_charged_amount,
    SUM(fee) AS total_merchant_fees
FROM "Stripe_2024_01_01-2024_12_31"
WHERE strftime('%Y', created_utc) = '2024'
GROUP BY month
ORDER BY month;