Hi, I have trouble filtering a composite metric b...
# gooddata-platform
p
Hi, I have trouble filtering a composite metric by an attribute. I have a composite metric, "Ratio Icon: TD SUM Charges Amount Objective" (first image), which is the ratio of two constituent metrics, "TD SUM Charges Amount" (second image) and "TD SUM Charges Amount Objective" (third image). Said composite metric is effectively
("TD SUM Charges Amount" ÷ "TD SUM Charges Amount Objective")
I have trouble filtering said composite metric by an attribute, "Metadata Realm", that's available on the dataset of the numerator metric, "Charge Line Item" (see LDM, fourth image). I have attempted the following methods to filter the metric: 1. Include the "Metadata Realm" filter directly in the numerator, "TD SUM Charges Amount", which only uses dataset "Charge Line Item" (see fifth image). The result is that the insights crash (see sixth image). 2. Include the "Metadata Realm" filter in the composite metric, "Ratio Icon: TD SUM Charges Amount Objective" (see seventh image). The result is that the insights crash (same as in (1)). 3. Attempt to add the "Metadata Realm" filter in the insight creator view (see eighth image). The attribute does not show when searching on the left or in the choices available for filter (see ninth image). I'm out of ideas. How can I apply a filter to a composite metric like this if the attribute exists only on one of the constituent metrics' source dataset?
j
Hi Pillippe, Metadata Realm is not connected to the objects used in the other dataset. You can achieve this through the use of a BY clause and a connection point in the connecting dataset. There is a document in our classic documentation that uses images from a legacy tool, but the concept is still the same. It is known as Explicit Lifting .
p
Hi Joseph, Thanks for your answer. I do not understand how to use the BY clause in this case. Where would you suggest this be applied (constituent metric or composite metric?), and how would the dependent insights need to be modified?
j
For example, you would want to start with Select Sum(Gross Amount) by connection point WHERE Date (Date) <This
p
So I'd do TD SUM Charge Amount = SELECT SUM(Gross Amount) BY Metadata Realm WHERE Date (Date) < this Then everything would would work out of the box?
j
This allows you to link to unrelated datasets, where the connection point acts as that link. There is a great free course on create metrics at GoodData University