Lookml sum reguardless of sign?

  • 17 September 2019
  • 2 replies

Hello Everyone,

I am new to looker and I am trying to figure out how to make sum 1 positive number and 1 negative number together regardless of the sign, example:

measure: sales_quality {

type: sum

sql: ${sale_quality}



in this “sale_quality” field, negative number could exist but we want to treat it as a positive number, so when we sum -1 and 2 together, we got 3. thank you!

2 replies

What you want is called “absolute value”. Most SQL dialects support some kind of function for this like or

adding that to the sql: parameter should compute the sum of absolute value (ie: always positive).

thank you Jackson