Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
pranaview
Contributor II

How to check if two words exist(in order) in the field value while loading the data

Hi Guys,

Requirement: I need to figure out if the values of a field that i'm loading has two words in it. For ex: Word1 and Word2

So what i want to check is this 

*Word1*Word2*    -  * being any character. 

Condition : Word1 has to come before Word2 that is where i am stuck right now.

Hope the requirement is clear. Please let me know how can i implement this. any help or suggestion will be much appreciated as i need to get this done asap.

Thanks,
Pranav 

1 Solution

Accepted Solutions
Highlighted
pranaview
Contributor II

Re: How to check if two words exist(in order) in the field value while loading the data

I think i got the solution, well one of the solution.

First i'll simply check for Wildmatch(Field,'*Word1 Word2*') and when this scenario is out of the way which is the most common then i will use TextBetween() function for the values which did not qualify for the above function/condition.

So, if(Len(TextBetween(Field,'Word1','Word2')) <> 0, 1,0) and I combine results from both the expression to create a flag.

I did not use Trim()above to handle any extra spaces(if any) between Word1 and Word2

On second thought, i think i don't even need to use the first expression. Textbetween() should take care of it.

Let me know if there's any other easier/better solution to this

Pranav

View solution in original post

1 Reply
Highlighted
pranaview
Contributor II

Re: How to check if two words exist(in order) in the field value while loading the data

I think i got the solution, well one of the solution.

First i'll simply check for Wildmatch(Field,'*Word1 Word2*') and when this scenario is out of the way which is the most common then i will use TextBetween() function for the values which did not qualify for the above function/condition.

So, if(Len(TextBetween(Field,'Word1','Word2')) <> 0, 1,0) and I combine results from both the expression to create a flag.

I did not use Trim()above to handle any extra spaces(if any) between Word1 and Word2

On second thought, i think i don't even need to use the first expression. Textbetween() should take care of it.

Let me know if there's any other easier/better solution to this

Pranav

View solution in original post