推荐公式:coalesce([CURRENT_USER.门店], '') <> ''
and coalesce([门店], '') <> ''
and size(
array_intersect(
split(
regexp_replace(
regexp_replace(
regexp_replace(lower(trim(coalesce([CURRENT_USER.门店], ''))), ',|、|;|;|\\|', ','),
'\\s+', ''
),
',+', ','
),
','
),
split(
regexp_replace(
regexp_replace(
regexp_replace(lower(trim(coalesce([门店], ''))), ',|、|;|;|\\|', ','),
'\\s+', ''
),
',+', ','
),
','
)
)
) > 0
公式解释:
判断用户属性 [CURRENT_USER.门店] 是否为空
判断数据字段 [门店] 是否为空
对用户属性与数据字段进行统一清洗:
转小写(避免大小写不一致)
去除首尾空格
统一分隔符(中文逗号、顿号等 → 英文逗号)
去除空白字符
压缩重复分隔符
将字符串按逗号拆分为数组
计算两个数组的交集(array_intersect)
若交集数量大于 0,则该行数据可见 |