Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trimming Data

I have a column of data that has Property Codes & Property Codes_Area Codes

3ALB272

3ALBERO7

3ALBER7A

3CAR16/2A

3BRAD5_BR2

3MANN2A_BR3

3MOZ3

3CP3-18

3MIT117_BR12

I need create a column that has just the property code, that is delete the _ and data after it.

The script below works for all that have an _ but doesn't bring across those that don't

Left (code,Index(code,'_')-1),code as Property_Code1,

How can I add to this, or is there another way, so that the column of info above ends up like below

3ALB272

3ALBERO7

3ALBER7A

3CAR16/2A

3BRAD5

3MANN2A

3MOZ3

3CP3-18

3MIT117

1 Solution

Accepted Solutions
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Have you tried Subfield ?

Subfield(code,'_',1) as Property_Code1

View solution in original post

1 Reply
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Have you tried Subfield ?

Subfield(code,'_',1) as Property_Code1