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: 
Anonymous
Not applicable

Multiple TextBetween?

Hi, I have this in my script right now and it is working.

TextBetween(Description, 'JHI_', ' - ') as Abbreviations

What I'd like to do is say

  TextBetween(Description, 'JHI_', ' - ') OR  TextBetween(Description, 'JHI_', ' _ ') OR  TextBetween(Description, 'JHI_', ' . ')  as Abbreviations

However the OR does not work here.  Ideas, suggestions? Please help. Thank you.

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

May be you can try with if condition, like

if(not IsNull(TextBetween(Description, 'JHI_', ' - ')),

  TextBetween(Description, 'JHI_', ' - '),

  if(not IsNull(TextBetween(Description, 'JHI_', ' _ ')),

  TextBetween(Description, 'JHI_', ' _ '),

  if(not IsNull(TextBetween(Description, 'JHI_', ' . ')),

  TextBetween(Description, 'JHI_', ' . ')))) as Abbreviations

View solution in original post

9 Replies
settu_periasamy
Master III
Master III

Hi,

May be you can try with if condition, like

if(not IsNull(TextBetween(Description, 'JHI_', ' - ')),

  TextBetween(Description, 'JHI_', ' - '),

  if(not IsNull(TextBetween(Description, 'JHI_', ' _ ')),

  TextBetween(Description, 'JHI_', ' _ '),

  if(not IsNull(TextBetween(Description, 'JHI_', ' . ')),

  TextBetween(Description, 'JHI_', ' . ')))) as Abbreviations

sunny_talwar

Not sure, but this might also work:

Alt(TextBetween(Description, 'JHI_', ' - '), TextBetween(Description, 'JHI_', ' _ '), TextBetween(Description, 'JHI_', ' . ') as Abbreviations

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try with Alt()

  Alt(TextBetween(Description, 'JHI_', ' - '), TextBetween(Description, 'JHI_', ' _ '), TextBetween(Description, 'JHI_', ' . ')) as Abbreviations


OR with If() like below


If(Len(TextBetween(Description, 'JHI_', ' - ')) > 0, TextBetween(Description, 'JHI_', ' - '),

If(Len(TextBetween(Description, 'JHI_', ' _ ')) > 0, TextBetween(Description, 'JHI_', ' _ '),

If(Len(TextBetween(Description, 'JHI_', ' . ')) > 0, TextBetween(Description, 'JHI_', ' . ')))) AS Addbreviations


Hope this helps you.


Regards,

Jagan.




preminqlik
Specialist II
Specialist II

ALT() is good as per jagan

Anonymous
Not applicable
Author

alt did not work. what is alt?

sunny_talwar

Then I would suggest going with the second option listed by Jagan.

If that still doesn't work, I would suggest providing a sample to work with.

Anonymous
Not applicable
Author

This worked, thank you

Anonymous
Not applicable
Author

Hi so I have another column where I need to search for keywords.   For example in this column, Short Description, I need to find the name application however the cells are populated differently.

1. application account updated.

2. The issue was application.

3.  application has been updated.

I need to extract the word application.

Thoughts? Thank you.

settu_periasamy
Master III
Master III

Hi,

You can try with WildMatch.. like

if(WildMatch(Short Description],'*Application*'),Your Expression, False Expression) as FieldName