Hi there,
Is there a way to manipulate a string from a user_attribute to use with an access filter?
I currently receive a attribute in the form of a simple string ‘1.1.1’.
I need append a ‘.%’ to such value, as exemplified below, so I can use in a LIKE operation.
access_filter: {
field: employee.hierarchy
user_attribute: CONCAT(hierarchy, ‘.%’)
}
}
Things to consider:
Solved! Go to Solution.
Hi @nestor!
Option 1: When you want to extend another explore, but still refine a sql_always_where or other string/block declarations, you can use often ${EXTENDED} to interpolate the value from the original declaration.
For example:
sql_always_where: ${EXTENDED} AND <additional condition>
(Non) Option 2: Within the access_filter block, there wouldn’t be a way to apply logic/liquid, as it only accepts a direct reference to a provided user attribute
Option 3: If the field referenced in the access_filter>field is a filter-type declaration, you can use its `sql` declaration to customize how the filter is applied. In your use case, I think you can really only express a single simple filter rule this way (rather than leverage {% condition %} tag)
view: employee {
filter: heirarchy {
sql: ${heirarchy_dimension} LIKE CONCAT({% parameter heirarchy %},’.%’) ;;
}
}