Thomas
01/22/2025, 1:15 PMSELECT COUNT({label/completions.id})
We are able to report on f.ex content.content_type by tag name, but not on the metric (or anything to do with completions). What are we doing wrong?Thomas
01/22/2025, 1:20 PMThomas
01/22/2025, 1:21 PMThomas
01/22/2025, 1:33 PMThomas
01/22/2025, 1:36 PMMoises Morales
01/22/2025, 2:44 PMSELECT COUNT({label/inventory.productid}) USING {label/purchases.purchaseid}
.
There are more details as to how to properly work with COUNT in the documentation here: https://www.gooddata.com/docs/cloud/create-metrics/maql/aggregation/count/
Lastly, please take into account the direction of the arrows, as it determines which dataset’s data can be analyzed (sliced) by the data from the other dataset. Please take a look at the following documentation which goes over some tips for data modelling: https://university.gooddata.com/tutorials/data-modeling/logical-data-model-five-pro-tips-for-data-modelling/Thomas
01/22/2025, 5:01 PMThomas
01/22/2025, 5:03 PMThomas
01/22/2025, 5:06 PMThomas
01/23/2025, 11:54 AMMoises Morales
01/23/2025, 1:02 PMThomas
01/23/2025, 1:03 PMThomas
01/23/2025, 1:03 PMThomas
01/23/2025, 1:03 PMThomas
01/23/2025, 1:05 PMThomas
01/23/2025, 1:10 PMMoises Morales
01/23/2025, 1:33 PMMoises Morales
01/23/2025, 1:34 PMThomas
01/23/2025, 1:53 PMMoises Morales
01/23/2025, 2:40 PMMultiple contexts for count, attribute='attribute/completions.id/df566d0354e04365b659c67b12c34766'
when not using a M:N connection, as the analytic engine cannot determine where the attribute "Tag name" is located. While context errors can often be resolved by introducing the USING
keyword in the metric definition, you are correct that this would not work here, as the root cause lies in how the datasets are connected.
With this said, the issue should be resolved by reviewing and adjusting the dataset connections.Thomas
01/23/2025, 2:41 PMThomas
01/23/2025, 4:53 PMMoises Morales
01/23/2025, 5:00 PMThomas
01/23/2025, 5:54 PMthe issue should be resolved by reviewing and adjusting the dataset connections.adjusting them to what? What is your recommendation in this case?
Thomas
01/23/2025, 5:54 PMMoises Morales
01/23/2025, 5:59 PMMoises Morales
01/23/2025, 6:00 PMThomas
01/23/2025, 6:15 PMThomas
01/23/2025, 6:15 PMThomas
01/24/2025, 9:39 AMMoises Morales
01/24/2025, 3:38 PMThomas
01/24/2025, 3:45 PMMichal Hauzírek
01/24/2025, 8:40 PMcontent --> taggings
(with foreign key in taggings) means that each tagging has exactly one content; and each content can have zero or more taggings.
And content <-->> taggings
(still with foreign key in taggings) means exactly the same thing, plus it allows to slice content by tags (with the double-sided arrow it is still slicing against the arrow).
(I am using ->>
here to mark the “initial” direction based on the foreign key; in the UI it is the black tip of the arrow vs the other being white).
Now to your questions
If I understand you correctly, you have elsewhere in the model : f.ex teams <-> team users <-> users -> completions
and you are able to slice completions
by team name
That is expected and it is because in this model you can go from completions
to f.ex teams
against the direction of those arrows.
But In case of completion <- content -> taggings <- tag name
you can not get from tag to the completion against the direction of the arrow. Some arrows go in different direction and there is no path "against the arrow" from completion to tag.
How to fix that
I assume from the name that taggings
is truely a M:N bridge table between content and tag name and therefore it makes sense to have the M:N there. You can set it on both arrows going to the taggings.
So changing it to completion <- content <-->> taggings <<--> tag name
should do the trick. Now you should be able to slice metrics from completion by tags, because it will be against the direction of the arrow - there is now a path from completion all the way to tag name going against the direction of the arrow.
I was able to do this in a very simplified model matching yours and am able to slice COUNT(completion ID) metric by tag name - see the screenshots:
I hope this helps.Greta
01/30/2025, 8:28 AMThomas
01/30/2025, 2:00 PMMichal Hauzírek
01/30/2025, 2:14 PM