Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Find texts of field with repeating pattern of characters

Hi community,

I have a series of repeating text that I would like to parse a  number out of.  The field is below:

td>Research Development</td><td align="right">32,457  </td><td align="right">24,795  </td><td align="right">25,151  </td><td align="right">26,894  </td></tr><tr>

How would I get the numbers that appear between the <td align="right"> and     There should be 4 of them. 

1 Solution

Accepted Solutions
whiteline
Honored Contributor II

Re: Find texts of field with repeating pattern of characters

you could use

TextBetween(SubField(String, '<td align="right"'), '>', '</td>') as Value

without N in the load script and it will store it exactly as you want.

5 Replies
whiteline
Honored Contributor II

Re: Find texts of field with repeating pattern of characters

=TextBetween(SubField(String, '<td align="right"', N), '>', '</td>')

Not applicable

Re: Find texts of field with repeating pattern of characters

How would I loop through the N's?  Can you show me a loop I could use in the script that would allow me to save the values for N =1 to 4 and store them in the same field?

whiteline
Honored Contributor II

Re: Find texts of field with repeating pattern of characters

you could use

TextBetween(SubField(String, '<td align="right"'), '>', '</td>') as Value

without N in the load script and it will store it exactly as you want.

Not applicable

Re: Find texts of field with repeating pattern of characters

Whiteline, is there anyway to say which of the subfields a subfield is with this method?  Ie, now I have 4 values for each of the strings in this column, is there any way to assign a sorting value to each of them?

whiteline
Honored Contributor II

Re: Find texts of field with repeating pattern of characters

Yes,

add a field:

rowno() as RowOrder

upd:

And my expression above is only a scratch. There are many useful string function in QlikView to handle text-parsing tasks.

Community Browser