Knowledge Drop

How do I get queries to run without symmetric aggregates applied?

  • 5 April 2021
  • 0 replies
  • 222 views

Userlevel 5
Badge
  • Looker Staff
  • 171 replies

Last tested: March 2021

 

You shouldn't do this. Symmetric aggregates are designed so that measure values are consistent no matter what joins are used in the query, and Looker does not support any solution that generates different measure values depending on what tables are joined.

But what about the symmetric_aggregates parameter? Doesn't that disable symmetric aggregates?

When you set symmetric_aggregates: no, all it does is disable any Measure that relies on symmetric aggregates and prevents it from running. It does NOT allow the measure to run a simple aggregation with no symmetric aggregates applied.

I understand that symmetric aggregates are Required for consistent and accurate results, but i have decided that I want inconsistent and inaccurate results. How do I do this?

Symmetric aggregates are applied with aggregation types like type: sum in LookML measures, but they are not applied when specifying an aggregate function in the sql parameter. So you can use a measure like the following:

measure: horrible_sum {type: numbersql: SUM(${value}) ;;}

Another option is to define all join relationships as one_to_one. Looker will assume that there are no fanouts created by your joins and will therefore never apply symmetric aggregates.

 

This content is subject to limited support.                


0 replies

Be the first to reply!

Reply