Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Tableau did not actually handle regex, but Alteryx does

EN6924
10 - Fireball

Hi All,

 

I wanted to build two columns using solely Regex because I have a column with the data listed follows.

-

EN6924_0-1671034192803.png

 

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

 

EN6924_1-1671034245201.png

 

However, Tableau is producing inaccurate results when I try to build calculated fields.

 

Column 1 -

 

EN6924_3-1671034439776.png

 

Column 2 -

 

EN6924_4-1671034474579.png

 

Getting incorrect results, as seen below -

 

EN6924_5-1671034525148.png

 

 

How can I resolve this issue? Kindly help.

 

5 REPLIES 5
PanPP
Alteryx Alumni (Retired)

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?

 

EN6924
10 - Fireball

In Alteryx the Regex expression is working fine, but in Tableau the same expression is not working.

 

 

PanPP
Alteryx Alumni (Retired)

The way tableau handles Regex would be different than Alteryx. It's not 1 to 1.

EN6924
10 - Fireball

What will be the expression in Tableau? If you have any idea kindly let me know

martinding
13 - Pulsar

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.

 

a.png

b.png

ab.png

   

 

Labels