<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Searching range of text data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391185#M489981</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get a somewhat working solution. There might be a bug though in advanced search featuers in QlikView (using version 11, SR2, 64-bit).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since QV does not provide any native functionality, and the advanced search feature does not save any typed in searches (i.e. writing an expression containing variables), I was forced to use a macro approach. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1. Make a word list by changing the load script (works quite well if you have to search inside just 1 field):&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13517667902478524" jivemacro_uid="_13517667902478524"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;// Splitting on ' ' (space), making 1 row per word. 5 words on a row = 5 rows in the table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WordList:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; OrderID, // unique key in FactTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField([Line Desc 1],' ') as SplittedWords &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;resident FactTable;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="padding-left: 30px;"&gt;2. Show the field as a list box on page (not necessary, but helps the debugging)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;3. Create two variables to contain 'from' and 'to' criteria:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;- vFrom&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;- vTo&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;and show them to the user in an InputBox&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;4. Create a button that runs a macro called SearchBetween&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;5. Create the SearchBetween macro:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13517667902453260" jivemacro_uid="_13517667902453260"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sub SearchBetween&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;set f = ActiveDocument.Fields("SplittedWords")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;f.Select ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vFrom = ActiveDocument.Variables("vFrom").GetContent().String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vTo = ActiveDocument.Variables("vTo").GetContent().String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;f.Select "= SplittedWords &amp;gt;= '"&amp;amp; vFrom &amp;amp; "' and SplittedWords &amp;lt;= '" &amp;amp; vTo &amp;amp; "'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;end sub&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only problem is the 'to' part of the search. This does not take the '=' - sign in consideration at all. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. &lt;/P&gt;&lt;P&gt;Searching the ExecutiveDashboard with:&lt;/P&gt;&lt;P&gt;vFrom = F*&lt;/P&gt;&lt;P&gt;vTo = H*&lt;/P&gt;&lt;P&gt;the list is only selected with words that starts with F and G. The same phenomena occurs when using advanced search. I.e., probably a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for the hints. It put me on the right track. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Sören&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2012 10:47:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-11-01T10:47:10Z</dc:date>
    <item>
      <title>Searching range of text data</title>
      <link>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391183#M489979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help on an issue regarding text fields and range searching. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation:&lt;/P&gt;&lt;P&gt;A table of transactions with corresponding explanation texts.&lt;/P&gt;&lt;P&gt;User wants to search the explanation text for words with a "between" functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. list of text (from QlikView's example file "Executive Dashboard", field: 'Line Desc 1'):&lt;/P&gt;&lt;P&gt;American Beef Bologna&lt;/P&gt;&lt;P&gt;American Cole Slaw&lt;/P&gt;&lt;P&gt;American Corned Beef&lt;/P&gt;&lt;P&gt;Applause Canned Mixed Fruits&lt;/P&gt;&lt;P&gt;Atomic Bubble Gum&lt;/P&gt;&lt;P&gt;Atomic Malted Milk Balls&lt;/P&gt;&lt;P&gt;Cutting Edge Sliced Ham&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User wants to be able to somehow type in:&lt;/P&gt;&lt;P&gt;&amp;gt;= American &amp;lt;= Atomic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and get the listed items beginning with 'A' selected. User also wants to type in &amp;gt;=C* &amp;lt;=D* and get these items selected:&lt;/P&gt;&lt;P&gt;American Cole Slaw&lt;/P&gt;&lt;P&gt;American Corned Beef&lt;/P&gt;&lt;P&gt;Applause Canned Mixed Fruits&lt;/P&gt;&lt;P&gt;Cutting Edge Sliced Ham&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any native functionalities that apply to these situations? Or do we have to create a field during loading that contains every single word in the "Line Desc 1" field to be able to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, what would be the best practice to link the parsed text to the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Sören&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 06:59:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391183#M489979</guid>
      <dc:creator />
      <dc:date>2012-11-01T06:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Searching range of text data</title>
      <link>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391184#M489980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could load the string in alongside corresponding numeric codes, and then load the strings in again as variables, named using their corresponding numeric codes. You could then use these numeric variable names within set analysis or if statements.&lt;/P&gt;&lt;P&gt;For the user interface you could have two input boxes for users to type in the from and to strings, though I'm not sure how you would then determine which variable matches each of the entries. Alternatively you could have a listbox of the original strings, set with the 'always one value' property, and then use two buttons to say 'use this one' as my from and my to. &lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 07:30:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391184#M489980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-01T07:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Searching range of text data</title>
      <link>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391185#M489981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get a somewhat working solution. There might be a bug though in advanced search featuers in QlikView (using version 11, SR2, 64-bit).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since QV does not provide any native functionality, and the advanced search feature does not save any typed in searches (i.e. writing an expression containing variables), I was forced to use a macro approach. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1. Make a word list by changing the load script (works quite well if you have to search inside just 1 field):&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13517667902478524" jivemacro_uid="_13517667902478524"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;// Splitting on ' ' (space), making 1 row per word. 5 words on a row = 5 rows in the table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WordList:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; OrderID, // unique key in FactTable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField([Line Desc 1],' ') as SplittedWords &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;resident FactTable;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="padding-left: 30px;"&gt;2. Show the field as a list box on page (not necessary, but helps the debugging)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;3. Create two variables to contain 'from' and 'to' criteria:&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;- vFrom&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;- vTo&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;and show them to the user in an InputBox&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;4. Create a button that runs a macro called SearchBetween&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;5. Create the SearchBetween macro:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13517667902453260" jivemacro_uid="_13517667902453260"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sub SearchBetween&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;set f = ActiveDocument.Fields("SplittedWords")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;f.Select ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vFrom = ActiveDocument.Variables("vFrom").GetContent().String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vTo = ActiveDocument.Variables("vTo").GetContent().String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;f.Select "= SplittedWords &amp;gt;= '"&amp;amp; vFrom &amp;amp; "' and SplittedWords &amp;lt;= '" &amp;amp; vTo &amp;amp; "'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;end sub&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only problem is the 'to' part of the search. This does not take the '=' - sign in consideration at all. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. &lt;/P&gt;&lt;P&gt;Searching the ExecutiveDashboard with:&lt;/P&gt;&lt;P&gt;vFrom = F*&lt;/P&gt;&lt;P&gt;vTo = H*&lt;/P&gt;&lt;P&gt;the list is only selected with words that starts with F and G. The same phenomena occurs when using advanced search. I.e., probably a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for the hints. It put me on the right track. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Sören&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 10:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Searching-range-of-text-data/m-p/391185#M489981</guid>
      <dc:creator />
      <dc:date>2012-11-01T10:47:10Z</dc:date>
    </item>
  </channel>
</rss>

