Hi
I have a somewhat complex dataset. It has both a many-to-many join + several lookup tables with untested data from array columns of the primary table in my dataset.
Here is what I am trying to accomplish:
I am trying to group by a dimension from one of the tables with untested array data and sum a column from the model joined in via the many-to-many relationship.
This gives a to high sum/total as many rows has several values in the array data model.
I then tried to counter this by multiplying by the ratio of the number of duplicate rows:
count( distinct {{ primary_key }} ) / count( {{ primary_key }} )
but this caused a fan-out error due to the many-to-many join that does not allow for that type of custom aggregations.
My request would be that you implement a solution, where I can define my primary key and you then make sure that the total row adds up correctly if included in this type of scenario.
For inspiration take a look at Looker’s primary key solution: primary_key