Doug Creighton
06/10/2024, 4:15 PMIvana Gasparekova
06/10/2024, 4:22 PMDoug Creighton
06/19/2024, 3:06 PMSELECT IFNULL( SELECT COUNT({label/cases.case_interaction_id})
WHERE {fact/analyze_case_clicked} = 1
AND {fact/eligible} = 1,0)
Completed
SELECT COUNT({label/case_interaction_id})
WHERE {fact/ert_completed} = 1
AND {fact/eligible} = 1
and {fact/analyze_case_clicked} = 1
Francisco Antunes
06/19/2024, 3:26 PMcase_interaction_id
with some filters added via the WHERE function.
It seems like adding the Supervisor Name is causing these two metrics to return null values (and since Analyzed
has an IFNULL, it shows 0 instead).
Can you tell me a bit more about the Supervisor Name attribute? How does it connect to the metrics? Is it possible that a null supervisor name impacts some of the objects being used in the metrics, causing them to be null?
I would suggest taking the troublesome metrics and simplifying them in steps (you can clone them, to avoid affecting the originals), removing WHERE statements step by step until you find the one that’s interacting badly with Supervisor name.Doug Creighton
06/19/2024, 3:29 PMIvana Gasparekova
06/19/2024, 6:22 PMFrancisco Antunes
06/20/2024, 1:18 PMcase_interaction_id
was actually present on several datasets (including the 2 main ones being used here, cases
and extra analytics
).
The problem was that the COUNT function being used by the metric didn’t set the context precisely, so it didn’t quite know which dataset to use in the calculations. When the Supervisor Name
attribute was introduced, it seemed to enforce this ambiguity, which would cause your metrics to fail - as it wasn’t clear to the engine how to contextualize the count (i.e.: which dataset it should be using to count the IDs). I suspect the M:N relationship between the datasets also played a part here.
The solution was actually quite simple: specifying the dataset to be used in the Analyzed
metric, like so:
SELECT COUNT ({label/cases.case_interaction_id}, {dataset/cases_instacart})
WHERE {fact/analyze_case_clicked} = 1
AND {fact/eligible} = 1
Once I did that, the visualization worked properly (see the screenshot). I’ve created a test visualization (DM-ing you the details) so you can see it in action. There is also a test metric being used there. Once you’ve adjusted the Analyzed
metric, feel free to delete both of these test objects!Doug Creighton
06/24/2024, 3:25 PMFrancisco Antunes
06/24/2024, 3:27 PMDoug Creighton
06/24/2024, 3:28 PMJakub Talaj
06/27/2024, 3:07 PMDoug Creighton
06/27/2024, 3:46 PMRadek Novacek
07/03/2024, 11:10 AMextra analytics
, but outside of that, including extra analytics
would simplify things and make Francisco's solution feasible.Doug Creighton
07/04/2024, 3:26 PMRadek Novacek
07/11/2024, 10:07 AM