Hi GoodData team, Is it possible to have a metric ...
# gooddata-cloud
m
Hi GoodData team, Is it possible to have a metric that counts firms who have exactly one associated matter (so far) for a barrister, within the given period? By given period, I mean the first matter's date falls within the applied date filter. I've prepared some metrics for this, but it doesn't seem to meet the expected requirement. For instance, when a barrister has been briefed by the firm 11 times (has 11 matters), then this firm will no longer be counted at all. What's currently happening is that, since the barrister has only been briefed by the firm once within this month, then it is still considered as a "new firm". Another example: 1. Given Barrister A has never had a matter with Firm A on Oct 15, 2025 2. When Firm A has a matter with Barrister A on Oct 16, 2025 3. Then Firm A will count as a ‘New Firm’ for Barrister A from the period that includes Oct 16, 2025 a. If the filter is FY Q1 (Jul-Sep) - then Firm A will not count as a New Firm for Barrister A b. If the filter is FY Q2 (Oct-Dec) - then Firm A now counts as a New Firm for Barrister A I wonder if this is something that we could do in GD? Thanks in advance and apologies for the long read!
👍 1
k
Based on the information in the knowledge sources, GoodData currently does not natively support dynamic filtering or metric logic that would allow you to count firms with exactly one associated matter for a barrister, where the first matter's date falls within the applied date filter, in the way you describe. Here are the key limitations and relevant points from the sources: - GoodData’s date filters are generally applied uniformly across the dataset, and you cannot create a metric that dynamically references the boundaries of a user-selected date filter as variables within the metric logic. This means you cannot, for example, count only those firms whose very first matter with a barrister falls within the selected period, and then exclude them if they have more than one matter overall—even if only one falls within the filter. The platform does not support this kind of "first occurrence within filter, and only if total count is one" logic natively in MAQL or via the UI [[source]](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069?thread_ts=1742495150.228069&cid=C04S1MSLEAW). - While you can use MAQL to filter and aggregate data (e.g., using WHERE, HAVING, and COUNT), and you can use date filters in visualizations, these filters do not allow for the kind of conditional, cross-period logic you’re describing. For example, you cannot create a metric that says "count firms where the first matter date is within the filter and the total number of matters for that firm-barrister pair is exactly one"—because you cannot reference the filter boundaries as variables inside the metric, nor can you easily determine the "first" matter in MAQL [[source]](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069?thread_ts=1742495150.228069&cid=C04S1MSLEAW). - Workarounds such as hardcoding date ranges or restructuring your data (e.g., creating a snapshot or long-format table) are possible, but these are not dynamic and would require manual updates or significant data model changes [[source]](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069?thread_ts=1742495150.228069&cid=C04S1MSLEAW). - There is no support for using “greater than” or “less than” operators in date filters in a way that would allow you to dynamically select the first matter per firm-barrister pair within the filter period [[source]](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069?thread_ts=1742495150.228069&cid=C04S1MSLEAW). Summary: What you are trying to achieve—dynamically counting "new firms" for a barrister based on the first matter date within a selected period, and only if there is exactly one matter overall—is not currently possible in GoodData using standard MAQL or UI features. The platform does not support referencing the date filter boundaries as variables within metric logic, nor does it support this type of conditional aggregation natively. Workarounds would require significant data model changes or manual metric updates. If this is a critical requirement, you may want to consider submitting it as product feedback, as other users have done for similar use cases [[source]](https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069?thread_ts=1742495150.228069&cid=C04S1MSLEAW).
📝 1
m
Adding here the used metrics, together with some screenshots, for reference:
Copy code
-- Matter Count Per Firm-Barrister --
SELECT COUNT({label/matter_id})
BY {label/contact_id}, {label/user_id}
WHERE {label/matter_is_draft} = "false"
AND {label/contact_is_archived} = "false"
AND {label/contact_role_type_name} = "Firm"
AND {label/user_type_name} = "Barrister";

-- New Firm With Matter Count -- 
SELECT COUNT({label/contact_id})
WHERE {metric/matter_count_per_firm-barrister} = 1
AND {label/contact_is_archived} = "false"
AND {label/contact_role_type_name} = "Firm"
USING {dataset/matters};
j
Hi Mira, Unfortunately, our AI is correct here. GoodData doesn’t currently support the exact type of metric you’re looking for. Specifically, it’s not possible to create a metric that will count firms who have exactly one matter with a barrister, where that first matter’s date falls within the date range selected by the user, and also ensure that this is the only matter ever for that firm-barrister pair.
Workarounds require manual or structural changes. You could hardcode date ranges or restructure your data (e.g., create a snapshot or long-format table), but these are not dynamic and would require ongoing manual updates or significant changes to your data model. You can also check a previous case where we've discussed this: https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1742495150228069
m
Okay, noted. Thank you so much for the explanation 🙌