Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Parse a record to the first comma

If I have records that are strings like "DDateRefGet, FORCED" and I just want the parts of the records until the first comma so "DDateRefGet" in our example, how would I do that?  Also some reords don't have commas and I want to keep those as they are.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Have you tried

subfield(FIELD,',',1) as NewField

?

View solution in original post

4 Replies
m_woolf
Master II
Master II

Something like this:

if(index(MyField,',')>0,left(MyField,index(MyField,',')-1,Myfield) as Myfield;

john_duffy
Partner - Creator III
Partner - Creator III

Hi Brandon.

This should work:

if(FindOneOf(Field1,',') = 0,Field1,TextBetween(Field1,left(Field1,1),',')) as NewField

swuehl
MVP
MVP

Have you tried

subfield(FIELD,',',1) as NewField

?

Not applicable
Author

In this case there are several ways to skin a cat!