Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

tarynnagel
New Contributor

Extracting characters from a string

Hi,

I am trying to extract specific address information from an address field where the field begins with a number.

e.g.

Row 1: 123 Address1

Row 2: Address2

I would like it to return the following

Address1

Address2

1 Solution

Accepted Solutions
MVP
MVP

Re: Extracting characters from a string

Maybe like

If( Isnum(Subfield(FieldName,' ',1)), Mid( FieldName, Index( FieldName,' ')+1, Len(FieldName) ), FieldName)

8 Replies
MVP
MVP

Re: Extracting characters from a string

May be like this:

SubField(FieldName, ' ', 2)

MVP
MVP

Re: Extracting characters from a string

Or maybe

Subfield(FieldName, ' ', SubstringCount(FieldName,' ')+1)

Not applicable

Re: Extracting characters from a string

Hi Taryn

U can use the right() function

=right(fieldName, 8)

tarynnagel
New Contributor

Re: Extracting characters from a string

For additional clarity.

I need all the characters after the numbers, there could be more than 1 space and various field lengths.

MVP
MVP

Re: Extracting characters from a string

Maybe something like

=Mid( FieldName, Index( FieldName,' ')+1, Len(FieldName) )

edit:

Ok, this won't return second row again...

Not applicable

Re: Extracting characters from a string

SubField(FieldName, ' ', -1)

MVP
MVP

Re: Extracting characters from a string

Maybe like

If( Isnum(Subfield(FieldName,' ',1)), Mid( FieldName, Index( FieldName,' ')+1, Len(FieldName) ), FieldName)

tarynnagel
New Contributor

Re: Extracting characters from a string

Fantastic, this one works perfectly. Thanks swuehl

Community Browser