Custom dimension based on filter

done
low_priority
reply

(Dawid) #1

Just wondering, is it possible to create a custom dimension based on filter?

Example: I want to allow people to choose a period of time using filters but I want to create a dynamic dimension that will split that range into two pieces.

Should I somehow use MAX of the date selected? But that won’t always work if the data ends before the end date selected by the user


(Izzy) #2

I bet you can do this using templated filters/parameters ( https://docs.looker.com/data-modeling/learning-lookml/templated-filters ).

The example on that page is for creating a filtered measure— Alas, the filters: parameter doesn’t work on dimensions, only measures. Nevertheless, you can probably create something similar by hand.

This article might prove useful on that quest or at least to get your brain churning: https://help.looker.com/hc/en-us/articles/360001285847-Timeframe-vs-Timeframe-Analysis-Using-Templated-Filters