Seemingly inconsistent SQL generation

I’m using liquid to dynamically switch the metric being used in a measure based on a parameter that users select on their dashboard.  I’m currently substituting in data into the SQL twice to switch the field being populated as well as the aggregation (sum vs count distinct).

Unfortunately I am confused why looker is seemingly populating strings into the SQL statement inconsistently with one string field being wrapped in parentheses and the other not.  For my SQL to work properly I need these strings to not be wrapped in parentheses.

In the screenshots below I am trying to understand why the filtered_measure_aggregation (in the red box) is being wrapped in parentheses while the filtered_measure_field (in the green box) is not.

Measure:

c5270d8c-87fb-469d-a672-c5929f0f323a.png

Dimensions:

e257c88d-0243-4d3e-b050-c7557fa41559.png

SQL:

c70f9291-faa6-4b77-b81c-98370831436b.png

Can anyone point me in the correct direction to keep the filtered_measure_aggregation portion from being wrapped in parentheses?

My backend is BigQuery Standard SQL if that matters in this instance.

Thank you in advance for any assistance provided!

0 4 306
4 REPLIES 4
Top Labels in this Space
Top Solution Authors