Filtered measures using SQL filter expressions

The problem starts when looker suggests that you can use sql as a filter expression inside a measure, but I have been looking around and I can’t find anything.

I need to filter a measure based on a condition. example:

measure: dinamyc_tons {

type:sum

sql: ${Tons}

filters: [month: (month calculated by another dimension)]

}

It is easy to add month: “December” or month: “12” but instead or hardcoding the filter and the measure, i need it to be dinamyc and change based on the value provided by another dimension.

if you stop typing after filters:[] , looker throws an error that says:

Expecting '[', 'string', 'numeric', 'yes', 'no', 'asc', 'desc', 'sql', ';;', 'expression', 'html', 'js', 'identifier', '-', '*', got ']'

from there i understand i can then use sql to perform the filtering action but i can’t find how, can you guys help me ???

0 2 4,003
2 REPLIES 2
Top Labels in this Space
Top Solution Authors