Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

subfield

Hello,

I have oen column in my table it is about title

it includes name ,department and title so I want to take only title part

for example

John Deep(Information Tecnology Department) - Chief Information Officer) I want to take bold part (title)

1 Solution

Accepted Solutions
Nicole-Smith

Do all fields like this have a hyphen in them?  If so,

=subfield(subfield(Field, '-', 2), ')', 1)

The inner subfield will take everything after the hyphen.  The outer subfield will take away the closing parenthesis at the end of it.

View solution in original post

7 Replies
Nicole-Smith

Do all fields like this have a hyphen in them?  If so,

=subfield(subfield(Field, '-', 2), ')', 1)

The inner subfield will take everything after the hyphen.  The outer subfield will take away the closing parenthesis at the end of it.

QSense
Creator II
Creator II
Author

Hi Nicole ,

İf name includes more than one hyphens What should it be?

For example

John Deep((Information Tecnology Department/Urp-Ist) - Chief Information Officer)

Urp-Ist is Location name abbreviation.

Nicole-Smith

=subfield(subfield(Field, '-', 3), ')', 1)

QSense
Creator II
Creator II
Author

For this example AHMET MENNAN MUFTUOGLU (Paz.& Sat.Bsk.(Yurtici) (Yurtici Ticaret Md./Psyi-Ist) - Uzman)

your code's result is : Ist

Nicole-Smith

It shouldn't be giving you Ist if you use 3 instead of 2 because it is saying take the 3rd section after stripping out the hyphens.  But if it's giving you Ist, then try it with a 4 instead of a 3

i.e.

=subfield(subfield(Field, '-', 4), ')', 1)

QSense
Creator II
Creator II
Author

It is the same and also

MURAT IRDESEL (Pazarlama ve Satis Bsk.(2.Bolge) (Taskent Md./Ps2) - Sef(Ticaret)(Yd))  for this sample,It only gives Sef(Ticaret   this result with '2' in code

When I make it '3' It gives no result


Nicole-Smith

For AHMET MENNAN MUFTUOGLU (Paz.& Sat.Bsk.(Yurtici) (Yurtici Ticaret Md./Psyi-Ist) - Uzman)

=subfield(subfield(Field, '-', 3), ')', 1)     (will return Uzman)

For MURAT IRDESEL (Pazarlama ve Satis Bsk.(2.Bolge) (Taskent Md./Ps2) - Sef(Ticaret)(Yd))

=left(subfield(Field, '-', 2), len(subfield(Field, '-', 2)) - 1)     (will return Sef(Ticaret)(Yd))

See attached.

Is there anything that is consistent between all of your fields?  It isn't good to have to write different expressions for each field.