I am trying to calculate the cost of different job types over the total number of operations over a date range. For this, I have a date_granularity calculated field that is truncating the date part of the depending on the user choice date_parameter:

I see your numerator that is {job_type_cost} has both {date_granularity}, {job_type} in the group by and only {date_granularity} for {num_operations_in_window} calculation or the denominator. Is that how you want your final metric to be calculated?

@juan_camilo_puello are you still having trouble with this problem, or were you are able to find a solution? If you were able to find a solution could you post it to help the community?

One thought I have here is that since you just want to show all operations in the window of time to turn that lac function into an ifelse statement.

ifelse(
{date} <= {date_granularity} AND
{date} >= {date_granularity},
distinct_count({operation_id}),
NULL)

You may need to experiment with this but this direction should get you around that LAC error.

It has been some time since there has been activity on this question, but we would still like to help find a solution. Are you still running into this problem or were you able to resolve this, and if so could you share the solution to help the community?

If we do not hear from you in 3 days this topic will be archived.