<?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: Substring search question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213635#M388952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny and thanks for replying&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Check out Massimo's answer below - that is what I was looking for....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Mar 2017 22:47:32 GMT</pubDate>
    <dc:creator>alexis</dc:creator>
    <dc:date>2017-03-15T22:47:32Z</dc:date>
    <item>
      <title>Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213631#M388948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the tables that I am reading from the source database has a field that we will call &lt;STRONG&gt;Products.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;The &lt;STRONG&gt;Products&lt;/STRONG&gt; field will typically contain semicolon separated values, e.g.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;DD;EX;CD;FG&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 10pt;"&gt;... &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;and let's suppose that in it's simplest for the table is loaded as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: terminal, monaco;"&gt;LOAD DISTINCT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyField&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(not IsNull(Products), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubFields(Products, ';')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As Product&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;FROM Products.qvd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This creates multiple records for each distinct KeyField/Product combination.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This approach is not desirable because I want to create a &lt;STRONG&gt;single&lt;/STRONG&gt; record for each Keyfield and want to instead create new columns that describe my Products data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Specifically, taking the &lt;EM style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;DD;PP;EX;PP;CD;FG&lt;/STRONG&gt;&lt;/EM&gt; example, let's suppose that I have the following classifications: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ClassA: DD,PP,DP,PD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ClassB: CD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ClassC: All the rest - I wish to ignore these (e.g. EX and FG above can be ignored)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I wish to change my load statement above where I will end up with a result that will comprise 4 fields:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;KeyField:&lt;/STRONG&gt; (as read from table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Products:&lt;/STRONG&gt; (as read from table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;ClassAProductCode:&lt;/STRONG&gt; (to contain the code (see list above) if found in Products - there can ever only be one of these values at any one time, DD in this example)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;ClassBFound:&lt;/STRONG&gt; (to contain a Y(es) if the Products field has a CD value in the string, or N(o) if it does not)&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;My logic tells me that there is a better way to do this than the following:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff; font-family: terminal, monaco;"&gt;LOAD DISTINCT&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyField,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Products,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Products),'none', &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(index(Products, 'DD')&amp;gt;0, 'DD',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;if(index(Products, 'PP')&amp;gt;0, 'PP',&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px; font-family: terminal, monaco; color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;if(index(Products, 'DP')&amp;gt;0, 'DP',&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: terminal, monaco; color: #0000ff;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;if(index(Products, 'PD')&amp;gt;0, 'PD'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;),&lt;SPAN style="font-size: 13.3333px;"&gt;'none'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As ClassAProductCode,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px; font-family: terminal, monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Products), 'N',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff; font-size: 13.3333px; font-family: terminal, monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(index(Products, 'CD')&amp;gt;0, 'Y','N'))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As ClassBFound&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757; font-size: 13.3333px;"&gt;&lt;SPAN style="color: #0000ff; font-family: terminal, monaco;"&gt;FROM Products.qvd;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any suggestions how this can be achieved more efficiently would be very much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanking you in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Alexis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 17:06:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213631#M388948</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2017-03-15T17:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213632#M388949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be use MapSubString() function here may be&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/MappingFunctions/MapSubstring.htm" title="https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/MappingFunctions/MapSubstring.htm"&gt;https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/MappingFunctions/MapSubstring.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 17:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213632#M388949</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-15T17:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213633#M388950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;// test data, replace with your qvd&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tmp:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load * Inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;KeyField,Product&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1, DD;PP;EX;PP;CD;FG&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2, DD;EX;CD;FG&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3, EX;CD;FG&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4, EX&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;5, EX;PD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;6, EX;PD;DP&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tmp2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Pick(WildMatch(Product, '*DD*', '*PP*', '*DP*', '*PD*', '*'), 'DD', 'PP', 'DP', 'PD', 'none') as ClassAProductCode,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Pick(WildMatch(Product, '*CD*', '*'), 'Y', 'N') as ClassBProductCode&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident tmp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table tmp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:21:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213633#M388950</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-03-15T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213634#M388951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Spot-on Massimo - thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 22:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213634#M388951</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2017-03-15T22:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213635#M388952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny and thanks for replying&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Check out Massimo's answer below - that is what I was looking for....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 22:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213635#M388952</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2017-03-15T22:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Substring search question</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213636#M388953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 23:38:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-search-question/m-p/1213636#M388953</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-15T23:38:51Z</dc:date>
    </item>
  </channel>
</rss>

