my question is so simple that I can’t understand why I can’t get it to work…
I have a variable time_to_event_group that is a string representing different group. I want to calculate the cumulative count of this divided by the total number of records in the table.
This is actually a valid expression, but when I visualize this as a line (X=time_to_event_group, Y=custom_mertric), the count that is used in denominator is evaluated as the count inside a specific time_to_event_group instead of the entire table. Note that I’m just trying to get a constant number here count({row_id}).
One thought I have to get around the order of evaluation is using PreAgg on your row id count. Please let me know if the following calculated field throws an error:
Hi @duncan
Thanks a lot for the suggestion. I have tried different version around this but I’m always getting the error “Mismatched Aggregation: Custom aggregations can’t contain both aggregated and nonaggregated fields, in any combination”
Thank you for getting back to me with the error! This may be happening because the time_to_event_group field is a string. You might just need to wrap one part in a sumover to make it an aggregate. Could you try nesting the last part in sumOver?:
Can you post a screenshot of the visual that is not displaying correctly? I tried to recreate this issue so I could understand what is happening better but I think I’m missing something.