Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Complex Character Trimming

Hi Everyone,

As part of my current work - I had to cross reference a selection of part numbers for an application I'm building. While these numbers are correct - the part numbers in the third column here have extra characters tagged on at the end as the picture attached below shows:

Reference Numbers Amend.jpg

What I would like to do here is remove the characters for part numbers in the 15-16 Levels field that begin with '-P' as this is not the required format for the data to be displayed. Can anyone help to provide an effective way of doing this?

Thanks,

Leigh

1 Solution

Accepted Solutions
Not applicable
Author

Hi Leigh,

Subfield([15-16 Levels],'-P',1) AS New Field

will just give you the first portion of the field before the '-P'

hope that helps

Joe

View solution in original post

4 Replies
Not applicable
Author

Hi Leigh,

Subfield([15-16 Levels],'-P',1) AS New Field

will just give you the first portion of the field before the '-P'

hope that helps

Joe

Not applicable
Author

Hi Joe,

Thanks for that.

Worked like a charm!

Thanks,

Leigh

Not applicable
Author

No problem glad to help.

That only really work if the field value is always -pxxx

if there is potential for that to differ, something like the below might work better.

left( KeepChar([15-16 Levels],'0123456789-') ,index(KeepChar([15-16 Levels],'0123456789-') ,'-',-1) -1)

Joe

vishsaggi
Champion III
Champion III

Hi,

As Simmons mentioned Subfield which functions stunningly superb.

The below would give you as you required. Provided if the right end of value have only 3 chars after hyphen '-'

left([15-16 Levels], Len([15-16 Levels])-4)

Cheers,
Vish.