Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
jmarotte
Contributor III
Contributor III

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

View solution in original post

sunny_talwar

Not sure, but this might also work:

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

jagan
MVP
MVP

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

jmarotte
Contributor III
Contributor III
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.

jmarotte
Contributor III
Contributor III
Author

This worked, thank you

jmarotte
Contributor III
Contributor III
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