Am I able to use liquid filters to determine the value of the 'hidden: ' field ?

I would like to use something like this so that I’m able to hide dimensions based on the name of the view.

 dimension_group: started_on {
hidden: "{% if _view._name == 'VIEW NAME' %} yes {% else %} no {% endif %}"
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}."STARTED_ON" ;;
0 2 244
2 REPLIES 2

I need the same.

Hey there! This is an interesting use case and approach. Quite intriguing!

I'm not sure if this method with the liquid is going to work, considering that the format of the liquid output may not be yes or no that the hidden parameter requires. The output may be returned in a string or within " " quotes and hence cause a syntax LookML error.

Regarding your use case, if your goal with this approach is to permission out access or limit control to teammates it's far better to utilize some of the security controls LookML has. You can build and apply user attributes and set certain access_filters within the LookML.

Top Labels in this Space
Top Solution Authors