I have a single dataset with client details and service hours details. I want to find the following metrics in QuickSight using calculated fields:
New active client hours: A new active client is defined as one whose earliest service date falls within that month.
Variance for new hours MoM (e.g., June to July).
New client numbers.
Variance for new client numbers MoM (e.g., June to July).
I’m able to get the client acquisition date using the formula below, but it doesn’t work for calculating the service hours for those clients for the months:
minOver(ServiceStartDate, [Clientid], PRE_AGG)
Also, has anyone done reporting for scenarios like below. If yes, could you please guide on this? I can write an sql view and create a report out of it but I dont want to replicating the datasets with such aggregations. Instead i would like to use my existing dataset and create Quicksight reports using calculated fields/functions.
Increase in hours from existing clients
Hours from new clients
Like for like hours
Decrease in hours from existing clients (negative)
Hi @Asfak,
There’s quite a bit to this question so I’ll try and break down a bit but without knowing your field options within your dataset, it may be hard to fully assist.
You’ll need to start by creating a calculated field to get earliest service date using minOver. Something like: minOver({service_date}, [{client_id}])
*Again, this would be dependent on your field options.
Then you can use that in an ifelse statement with extract.
Which may look something like:
Then, you can do a new client count with a sumOver calculation. Something like: sumOver({is_new_client}, [{service_date}])
You can follow similar steps that you did for #2.
As mentioned above, without knowing your available field options within the dataset, it makes this a little trickier. After trying these out, feel free to upload a sample analysis to QuickSight Arena view if you have any remaining questions as that will allow easier assistance.
Hi @Asfak,
First off, you’ll want to create a Month calculated field for any future monthly partitions, which you can achieve using the truncdate function.
In regards to Question 1 (and 4)…looking at what you’d like to achieve, you’ll need to create separate calculated fields for ‘increase’ and ‘decrease’ if you’d like them to have their own columns. I’d suggest exploring the sumOver calculation for these and partition by your month calculated field.
I don’t see anywhere on your example where you’re utilizing the hours from new clients…do you just want an overall count of unique new clients or what are you trying to achieve for this?
I’m not sure what you mean by like for like hours so please explain further what this would do?
Hi @Asfak,
Since we haven’t heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for any relevant information that may be needed.