Looker date filter for last year

Hello everyone,

I’m new at looker and while doing some operations i found myself in a positiion where I need to show a comparison between “This year” and “Last Year” sales.

At first I did the following:

measure: ventas_netasAA {
label: "Venta NetaAA"
type: sum
sql: ${venta_neta} ;;
filters: [fecha_year: "last year"]
value_format_name: usd
}

My issue then is that it appears to only work on this “2021” year vs the “2020” but the rest of the data (2019, 2018) is shown as zero. 

My logic is , if the year im trying to compare is 2021 i wanna see past years so switch to “year -1” and then display the aggregate, the issue is that i am not sure on how to do that on LookML.

0 5 3,471
5 REPLIES 5
Top Labels in this Space
Top Solution Authors