DifficultyEASY

Customer Spending Summary

Description

You are given a dataset of customer sales. Your task is to calculate the total spending and the number of transactions for each customer. Only include customers who have spent more than $1,000 in total.

Data Sample

sale_iddatecustomer_idamount
1012024-05-015011500.5
1022024-05-015022300
1032024-05-02503450.75
1042024-05-02501120

Expected Output

customer_idtotal_spenttxn_count
5012400.53
50228602
5031651.152
50531001

Note: Login to run real Queries.

codecell_01.py
Module: Aggregations
PYSPARK_ENV: 3.4.1