Let’s say I have a list of user_ids = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
group_a = [0, 2, 7, 8, 4]
group_b = [1, 3, 9, 5, 6]
Is it possible to compare these two groups for a certain measure, let’s say earnings, without creating a new dimension. I need to do this multiple times for different user_ids but I do not want to create a seperate dimension every time.
I have tried this as a custom filter:
matches_filter(${users.user_ids},
0, 2, 7, 8, 4)
but then logically I can only see the results of group_a. Is there a way to see group_b as well, within the same graph?
Hey Stephen!
Here’s a good duct tape method with Custom Measures:
I mentioned this as the duct tape method; a more ‘persisted’ way of accomplishing this would be to have two measures (measure_cohort_a, and measure_cohort_b) that use templated filters so the cohorts can be dynamically modified as needed. The other bonus with this method is that you’d be able to pre-fabricate cohort variance analysis fields (in absolute or percentage-based terms). https://docs.looker.com/data-modeling/learning-lookml/templated-filters