Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Last Character for Text Between?

I am currently using the Stripping HTML Tags using Regular Expressions - 4GuysFromRolla.com VB script module to remove HTML tags from a field. I am then using TextBetween to break out the DESCRIPTION_CLEANED field to 5 separate fields. It works for the first 4 but for Voting Statement, I don't know what to do as the ending string because the data is being truncated and the Analytics string is sometimes not included. Similarly, for Analytics, I don't know what to put as the final string. Is there a function to pull last characters?

Select DEFECT_ID 8816 or 7474 as examples.

  stripHTML(DESCRIPTION) as DESCRIPTION_CLEANED,
TextBetween( stripHTML(DESCRIPTION) , 'Current State Summary:' , 'Problem Statement:' )  as CUR_STATE_SUMMARY,
TextBetween( stripHTML(DESCRIPTION) , 'Problem Statement:' , 'Proposed Solution:' )  as PROBLEM_STATEMENT,
TextBetween( stripHTML(DESCRIPTION) , 'Proposed Solution:' , 'Voting Statement:' )  as PROP_SOLUTION,
TextBetween( stripHTML(DESCRIPTION) , 'Voting Statement:' , 'Analytics:' )  as VOTING_STATEMENT,
TextBetween( stripHTML(DESCRIPTION) , 'Analytics:' , 'Analytics'as ANALYTICS,

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Not sure may be put an empty string like

TextBetween( stripHTML(DESCRIPTION) , 'Analytics:' , '' as ANALYTICS,

View solution in original post

11 Replies
cbaqir
Specialist II
Specialist II
Author

Anyone?

cbaqir
Specialist II
Specialist II
Author

Maybe   some sort of end function?

vvira1316
Specialist II
Specialist II

Would it be possible to provide a sample HTML string (DESCRIPTION) and what all parts from that you are looking for?

vishsaggi
Champion III
Champion III

Can you share one example ID where we have data for Analytics: delimiter?

cbaqir
Specialist II
Specialist II
Author

The problem is that it changes. Sometimes it is not populated with text and sometimes it's just HTML formatting.

DEFECT_ID: 6753

    Current State Summary:
   
    text here
   
    Problem Statement:
   
    text here
   
    Proposed Solution:
   
    text here
   
    Voting Statement:
  
   text here
   
    Analytics:
   
    <td align="left" valign="middle" width="649" height="117" style="border:

vishsaggi
Champion III
Champion III

Yes, is there any ID which has this Analytics data? I mean for other text you have some text information between right? From the ID's you have, are there any values with the text for Analytics. Just wanted to check the pattern so that we can come up with some other alternative.

_datadude
Partner - Contributor III
Partner - Contributor III

Hi Cassandra,

suggesting a different framework is probally not the solution you are actually looking for, but maybe this framework makes it very much easier for you?

http://html-agility-pack.net/?z=codeplex‌‌

Html Agility Pack - HTML Attributes

All the best,

Markus

cbaqir
Specialist II
Specialist II
Author

I can't find one off hand.

cbaqir
Specialist II
Specialist II
Author

And my issue is because sometimes there is no data, I don't know what to put here:

TextBetween( stripHTML(DESCRIPTION) , 'Analytics:' , 'Analytics' as ANALYTICS,