Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
stabben23
Honored Contributor

Read between two words

Hi I try to read text between two words, I use today TextBetween and it works when I have the second word.

Sometimes I dont have the second word and then it fail to read that line.

In my example I read: textbetween(Statement,'FROM ', 'WHERE' ) and this will give me the datasource, but sometimes ther is no WHERE statment in my query, any Idea?

//Staffan

Tags (1)
4 Replies
Not applicable

Re: Read between two words

Can you please post sample data ?

stabben23
Honored Contributor

Re: Read between two words

No, but like this:

bla bla lot of text bla bla FROM datasource Where A=B, this works and will give me datasource

bla bla lot of text bla bla FROM datasource, won´t work, gives me nothing.

//Staffan

MVP
MVP

Re: Read between two words

something similar to

=if(index('$(vText)','where'),

TextBetween('$(vText)', 'from', 'where')          // where exists

, SubField  ('$(vText)', 'from', 2))                    // where doesn't

but what about group by, order by , etc......?

vText is a variable in InputBox

Regards

stabben23
Honored Contributor

Re: Read between two words

That works, I have try them all, but not in the same if statment, nice.

You have also a point about group/order by, that will be the next to solve.

//Staffan

Community Browser