Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
crystles
Partner
Partner

Limit string by character in string

I have a string field called "Part Description". We have thousands of parts, but thankfully have a very good naming convention, where the first part of the string is the broad definition of the part, then a comma, then other descriptions of the part.

EX:

     Hammer, Blue, Light Weight

     Hammer, Red, Heavy Weight

     Screw Driver, Yellow, Medium Weight

I need to be able to pull the first section of the string before the FIRST comma. It would be easy if they were all the same character spaces, but the descriptions are all different lengths, before and after the first comma and also have spaces in some of them.

I have thought of different ways to accomplish this, using either Replace(), or TextBetween(), but they seem kind of cumbersome and I was wondering if anyone had a better, more efficient way of accomplishing this?

Any help is greatly appreciated! Thank you!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi cryatles,

Try,

Subfield(Part Description, ',',1)

View solution in original post

5 Replies
jsaradhi
Specialist
Specialist

subfield(Part, ',') where Part is your field name. that should do it.

tamilarasu
Champion
Champion

Hi cryatles,

Try,

Subfield(Part Description, ',',1)

View solution in original post

sunny_talwar

What about SubField()? May be this:

SubField(Fieldname, ',', 1)

tamilarasu
Champion
Champion

Add square brackets in your field name, since you have space in your field. i.e Subfield([Part Description],',',1)

crystles
Partner
Partner
Author

The Subfield() function worked perfectly! Thank you!