Hello,
I have a dataset of 2M+ rows where each row represent one sale / use of a service.
The dataset contains a lot of different information regarding the customer, payment etc., but the relevant fields for what I want to do are:
- Timestamp for when the customer signed up
- Timestamp for when the customer used the service
- Customer id (unique per customer)
- Service id (unique per use of service)
With the timestamps in combination with the customer id I would like to segment customers into different categories, for example:
- A customer who has used the service at least 5 times the last 3 months (more than 5 uses 0-3 months ago)
- A customer who has used the service at least 5 times the last 6 months (more than 5 uses 0-6 months ago)
- A customer who has not used the service the last 3 months, but used it at least 5 times the last 6 months (more than 5 uses 3-6 months ago)
and so on…
Currently I am able to categorize the customers by:
- When their last purchase was using:
maxOver({created_at[order]},[{customer_id}],PRE_AGG)
- How many times each customer has used the service:
countOver({unique_service_id}, [{customer_id}], PRE_AGG)
The problem is that I am struggling to figure out how I can count the number of uses within a specific time period for a specific customer. Are there calculations available in Quicksight to calculate this?
Any help to push me in the right direction is much appreciated.