Hi All,
I wanted to build two columns using solely Regex because I have a column with the data listed follows.
-
It worked perfectly -
Column 1: if REGEX_Match([Source], "[^\|]+") then [Source] else Null() endif
Column 2: if REGEX_Match([Source], "[^\|]+\|MAPP") then [Source] else Null() endif
However, Tableau is producing inaccurate results when I try to build calculated fields.
Column 1 -
Column 2 -
Getting incorrect results, as seen below -
How can I resolve this issue? Kindly help.
Solved! Go to Solution.
Hi @EN6924
Are you able to perform the regex expressions in Alteryx and then just output the columns to Tableau via the tableau output tool?
In Alteryx the Regex expression is working fine, but in Tableau the same expression is not working.
The way tableau handles Regex would be different than Alteryx. It's not 1 to 1.
What will be the expression in Tableau? If you have any idea kindly let me know
Hi @EN6924,
I have to admit, Tableau's regex is indeed behaving unexpectedly!
The docs didn't help, but you are welcome to have a look if you like. Tableau's Regex: https://unicode-org.github.io/icu/userguide/strings/regexp.html
I used a workaround to hopefully achieve your desired output.
Anyways, I think it might actually be easier to do these in Alteryx first, then have a label called Column, with values = "col1" and "col2",
then in Tableau, write something such as IF Column = "col1" THEN Source ELSE "" END for col1 calculated field, and repeat for col2 calculated field.