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: 
cbaqir
Specialist II
Specialist II

Load Characters After String?

I have a field called DESCRIPTION that stores HTML formatted text (see below) and I want to be able to create 4 separate fields (one for each highlighted section below) with the data after it populated as the field value. Is there anyway to do this in QV?

I was hoping to use something like left(DESCRIPTION, "Current State Summary:") ... to say pull everything between Current State Summary and Problem Statement as the value of Current State Summary.

For example, with the image below (currently all part of DESCRIPTION field), I want this:

Current State SummaryProblem StatementProposed SolutionVoting Statement

Currently when a patient...

... /MD orders.

This current Hospice...

...palliative care goals.

Develop a power plan...

...physicians and bedside nurses.

Requesting to update...

...hospice level of care.

8-28-2017 12-27-50 PM.jpg

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

You should be able to extract the text by using the function TextBetween() like this:

TextBetween( TextBetween( Description , '<b>Current State Summary:</b>' , '<div' ) , '">' , '</span></font>') ;

You might also have to replace the  & nbsp ;   which means non-breaking-space with just a regular space:

Replace( TextBetween( TextBetween( Description , '<b>Current State Summary:</b>' , '<div' ) , '">' , '</span></font>')  , Chr(38)&'nbsp;' , ' ' ) ;

The last three passages does not have a trailing colon immediately after the last character:

Replace( TextBetween( TextBetween( Description , '<b>Problem Statement</b>' , '<div' ) , '">' , '</span></font>') , Chr(38)&'nbsp;' , ' ' ) ;

View solution in original post

3 Replies
petter
Partner - Champion III
Partner - Champion III

You should be able to extract the text by using the function TextBetween() like this:

TextBetween( TextBetween( Description , '<b>Current State Summary:</b>' , '<div' ) , '">' , '</span></font>') ;

You might also have to replace the  & nbsp ;   which means non-breaking-space with just a regular space:

Replace( TextBetween( TextBetween( Description , '<b>Current State Summary:</b>' , '<div' ) , '">' , '</span></font>')  , Chr(38)&'nbsp;' , ' ' ) ;

The last three passages does not have a trailing colon immediately after the last character:

Replace( TextBetween( TextBetween( Description , '<b>Problem Statement</b>' , '<div' ) , '">' , '</span></font>') , Chr(38)&'nbsp;' , ' ' ) ;

cbaqir
Specialist II
Specialist II
Author

Thank you!

petter
Partner - Champion III
Partner - Champion III

notice that I did an edit due to limitations in the community editor for the & nbsp ; 

it is converted into a real space in the community editor so I had to do the trick with Chr(38) and so forth....