Alteryx designer Discussions

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

String Parsing

Asteroid

Hi All,

 

I have string parsing requirement as follows.

"Kannan ABCD Building" -> Source Text

I need to parse first 10 chars as Name.
remaining as Address.
Like

Kannan ABC as Name
But remaining as Address however like this
ABCD Building

That is I have to see if the 11 th charcter is part of particular word,If so I have to parse that too as Address

Could you please advice on how to achive this.

Currently I have following:

To Parse Name:

Left([SourceText],10)

To Parse Address:

IF Length([SourceText]) > 10 THEN

Substring([SourceText],10,Length([CompanyName])-1)

 

Thanks,

Krish

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@Krish,

 

In line with how you were attempting this.....

 

If the first word is more than 11 bytes, then get that first word as Name, otherwise take the leftmost characters up to the last space as Name.

 

Name =

IF Length(GetWord([String], 0)) >= 10
	THEN Getword([String],0)
ELSE
	Trim(Left([String],10-FindString(ReverseString(left([String],10)),' ')))
ENDIF

Address =

Trim(Replace([String],[Name],''))

Seems to work for me....

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
Asteroid

Thanks a lot.The reverse string usuage helped to identify proper start index location.

I re arranged for my requirement.It worked.

 

Thanks!

Highlighted
Asteroid

Thanks a lot.The reverse string usage helped to identify proper start index location.

I re arranged for my requirement.It worked.

 

Thanks!

Highlighted
Asteroid

Thanks.It worked!

 

Labels