Hi,
I have a filter for string type and in the dropdown it shows
the options based on which we can filter, Can we restrict these options for users somehow either through lookml or the ui?
The string column named “hashtags” might contain a list or a single word like:
SO, when someone tries to filter with hashtag “is equals to” looker, it will show only 1 row but when it will be like hashtag “contains” looker, it will give all the 3 rows.
So, I want to restrict the option “is equals to” from the above list so that customer does not gets confused.
For example: say I just want the customer be only be able to filter through “contains” and disable/remove all other options for this filter.
or
is there a way in lookml where I can put condition within filter like say if customer choses “is equals to”, then filter using this sql condition , other wise use the other sql condition.
Solved! Go to Solution.
Hi @kv3
Adding on to @Eric_Lyons’s answer, you could create one more parameter which allows the end user to choose ‘Equals to’ or ‘Not Equals to’, which changes the sql in the yesno dimension based on the user’s chosen value
dimension: contain_string {
type: string
sql: CONCAT('%',{% parameter parameter_named_string %},'%') ;;
}
parameter: contains {
type: unquoted
allowed_value: {label: "Equals to" value: ""}
allowed_value: {label: "Not Equals to" value: "NOT"}
}
dimension: yesno_filter {
type: yesno
sql: ${state} {% parameter contains %} LIKE ${contain_string} ;;
}
I’ve added some screenshots of how it would be used below:
I hope this helps. Let me know if you have any questions
Naomi, Redkite