Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Remove characters before a special character

Hi,

So I have a field which has a '-' at different places within the field. In all cases I want to only show the characters that appear after the -.

For example:-

stu-art   should be    art

s-tuart   should be    tuart

What type of expression can I use to get around this?

Thanks

Stuart

1 Solution

Accepted Solutions
MVP
MVP

Re: Remove characters before a special character

Subfield(YourFieldName,'-',2) as YourFieldName

or

Subfield(YourFieldName,'-',-1) as YourFieldName

5 Replies
MVP
MVP

Re: Remove characters before a special character

Subfield(YourFieldName,'-',2) as YourFieldName

or

Subfield(YourFieldName,'-',-1) as YourFieldName

Re: Remove characters before a special character

Hi

try below

subfiled(field,'-',2)


Regards

ASHFAQ

Not applicable

Re: Remove characters before a special character

Hi,

Sorry i should have said that the field could be any lenght.

For example we could have

ffffffffffffffffffffffffff-f

or

ggggggggggggggggggggggggggggggggggggggggg-aa

Re: Remove characters before a special character

That should work.

Regards

ASHFAQ

ecolomer
Honored Contributor II

Re: Remove characters before a special character

Use SubField:

Subfield(FieldName,'-',2) as NewFieldName