I am using a dimension like this in MySQL and need to convert it to Redshift:
- dimension: major_version
type: number
sql: SUBSTRING_INDEX(${number}, '.', 1)
Is there something like SUBSTRING_INDEX in Redshift?
I am using a dimension like this in MySQL and need to convert it to Redshift:
- dimension: major_version
type: number
sql: SUBSTRING_INDEX(${number}, '.', 1)
Is there something like SUBSTRING_INDEX in Redshift?
Something like this should work…
SUBSTRING(${number},1, POSITION('.',${number}) -1))
You may have to play with it to check for edge conditions and such.
I’ve done something pretty something similar with SPLIT_PART Bucketing Users By Email Address - would that work?
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.