'How can I filter for specific combinations in Google Data Studio?
I have a data set with multiple lines per person and the type of fruit they selected on a particular date. I would like to create a filter to show me people that selected specific combinations (i.e. apple and pear). Ideally I would like to be able to incorporate a date filter as well but this is a secondary need.
I tried using the following as a new field, as a metric, and as a calculated control field but I get the same error message for all of them:
CASE
WHEN SUM(Apple) > 0 AND SUM(Orange) > 0 AND SUM(Pear) = 0 THEN 'Apple and Orange'
WHEN SUM(Apple) > 0 AND SUM(Orange) = 0 AND SUM(Pear) = 0 THEN 'Apple'
WHEN SUM(Apple) = 0 AND SUM(Orange) = 0 AND SUM(Pear) > 0 THEN 'Pear'
WHEN SUM(Apple) = 0 AND SUM(Orange) > 0 AND SUM(Pear) = 0 THEN 'Orange'
WHEN SUM(Apple) > 0 AND SUM(Orange) = 0 AND SUM(Pear) > 0 THEN 'Apple and Pear'
WHEN SUM(Apple) > 0 AND SUM(Orange) > 0 AND SUM(Pear) > 0 THEN 'Orange and Pear'
ELSE 'other'
END
I keep receiving this error message:
Metric expressions and aggregations are not allowed in this expression.
however I don't have any metrics included in the calculation.
Resources that might help:
Picture of data layout:

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
