i have a dataframe like this :
customer_id | trx_date | trx_amount | last_trx |
---|---|---|---|
CS5295 | 2013-02-11 | 35 | 2014-11-25 |
CS5295 | 2014-11-25 | 54 | 2014-11-25 |
CS5295 | 2013-05-22 | 36 | 2014-11-25 |
CS5295 | 2012-12-24 | 36 | 2014-11-25 |
CS5295 | 2013-03-22 | 43 | 2014-11-25 |
CS5295 | 2013-02-11 | 25 | 2014-11-25 |
how can i count the trx_amount, from last month in last_trx, and customer_id as a parameter?
Expected Output :
customer_id | trx_times |
---|---|
CS5295 | 1 |
from the last month of the date in last_trx, 2014-11-25
counting how many times did customer_id make a trx from 2014-10-25 to 2014-11-25