Is there a way to choose not year by the name (fx. “2025”), but by ISO year?
Meaning fx that ISO 2025 will include 2024-30-12 and 2024-31-12, and exclude 2025-29-12, 2025-30-12 and 2025-31-12?
Week_of_year is already done the ISO way, but when I filter by a year for comparison, it does not take the overlap into account.
Looker’s native year dimension uses the calendar year, so filtering by it won’t align with ISO week/year boundaries. To work with ISO years, you’ll need to define a custom dimension in LookML using extract_iso_year logic via SQL from your database, for example:
lookml
dimension: iso_year {
type: number
sql: EXTRACT(ISOYEAR FROM ${TABLE}.date_column) ;;
}
```
Once defined, you can use `iso_year` in filters and comparisons, ensuring it matches ISO week conventions. If you’re working in Looker Studio, you can achieve similar behavior with a calculated field using your data source’s ISO year function.
Thanks and regards,
Taz