Checking for string in Array

Hi,

How best can I check if a string is IN an array.

Lets say this is the dimension (array):

dimension: tags {
type: string
sql: ${TABLE}.tags ;;
}

This measure doesn’t work

measure: fund_count {
    type: sum
    sql:
      CASE WHEN ${TABLE}.tags LIKE '%"Fund Fee"%'
          THEN ${count}
      END ;;
  }

Thanks.

Solved Solved
0 1 1,755
1 ACCEPTED SOLUTION

Found the answer:

I added JSON_SERIALIZE to the dimension array

dimension: tags {
​​​​​​​ type: string
sql: JSON_SERIALIZE(${TABLE}.tags) ;;
}

View solution in original post

1 REPLY 1

Found the answer:

I added JSON_SERIALIZE to the dimension array

dimension: tags {
​​​​​​​ type: string
sql: JSON_SERIALIZE(${TABLE}.tags) ;;
}
Top Labels in this Space
Top Solution Authors