Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

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 

Labels (5)
1 Solution

Accepted Solutions
pranaview
Creator III
Creator III
Author

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
pranaview
Creator III
Creator III
Author

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