<?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: Search data of Table1 in Table2 in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490302#M101910</link>
    <description>&lt;P&gt;You could force a join and have the each Package in [Packages] table joined to each Purchasaed in [Sales] table (40*10000 rows) then do a SubStringCount(Purchased, Packages) and cleanup your tables.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2024 06:07:02 GMT</pubDate>
    <dc:creator>Tomm</dc:creator>
    <dc:date>2024-11-01T06:07:02Z</dc:date>
    <item>
      <title>Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490283#M101909</link>
      <description>&lt;P&gt;Hello there!&lt;/P&gt;
&lt;P&gt;I have two tables, one called &lt;STRONG&gt;Packages&lt;/STRONG&gt; and the other called &lt;STRONG&gt;Sales&lt;/STRONG&gt;. Packages has 40 items in only one field and Sales has 10,000 items with different fields.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the sake of simplicity I will use “examples”, not the real, long field contents.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Packages has these items: A1, X3, W6, H8.&lt;/P&gt;
&lt;P&gt;Sales has one field (out of many) that often contains, among long strings of texts, the items listed in Packages and others, called &lt;EM&gt;Purchased&lt;/EM&gt;, as follows:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SaleNo… Purchased&lt;/P&gt;
&lt;P&gt;721. &amp;nbsp; &amp;nbsp;A1,,,,&lt;/P&gt;
&lt;P&gt;5. &amp;nbsp; &amp;nbsp;X3;;; H8::: Z7 asdfghjkl Q4&lt;/P&gt;
&lt;P&gt;36. &amp;nbsp; &amp;nbsp;A1;; .. W6 fgdshg H8&lt;/P&gt;
&lt;P&gt;807. &amp;nbsp; &amp;nbsp;Sawtfcd hgfd kkklg sddfd&lt;/P&gt;
&lt;P&gt;15. ssdfd X3 gfgdddljj poiigvf C5 H7 V2&lt;/P&gt;
&lt;P&gt;205. H8.cvc hbbb A1&lt;/P&gt;
&lt;P&gt;At load script I need to find and tag all &lt;I&gt;Sales.Purchased&lt;/I&gt; the items where the items in &lt;I&gt;Packages&lt;/I&gt; are found. It can be in one additional field or more than one, as long as I get, for instance, that SaleNo 5 contains X3 and H8, SaleNo 807 has no matches, SaleNo 205 contains A1 and H8, etc. And it is not a binary tag, I need to know which Package is in Purchased.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is to go through each item in Packages browsing all items in Sales to find out what Package matches within Purchased.&lt;/P&gt;
&lt;P&gt;Any hints are appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 02:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490283#M101909</guid>
      <dc:creator>DEMONIO_AZUL</dc:creator>
      <dc:date>2024-11-01T02:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490302#M101910</link>
      <description>&lt;P&gt;You could force a join and have the each Package in [Packages] table joined to each Purchasaed in [Sales] table (40*10000 rows) then do a SubStringCount(Purchased, Packages) and cleanup your tables.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 06:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490302#M101910</guid>
      <dc:creator>Tomm</dc:creator>
      <dc:date>2024-11-01T06:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490320#M101913</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/295559"&gt;@DEMONIO_AZUL&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;map_items&lt;/FONT&gt;&lt;/STRONG&gt;:&lt;BR /&gt;&lt;STRONG&gt;mapping&lt;/STRONG&gt; LOAD Items,&lt;BR /&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;lt;' &amp;amp; Items &amp;amp; '&amp;gt;' as map_text&lt;BR /&gt;FROM &lt;STRONG&gt;Packages_table&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;sales_table:&lt;BR /&gt;LOAD *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(textbetween(mapsubstring('&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;map_items&lt;/FONT&gt;&lt;/STRONG&gt;',&lt;STRONG&gt;purchased&lt;/STRONG&gt;),'&amp;lt;','&amp;gt;'),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Item found','Item not found') as Flag&lt;BR /&gt;FROM sales table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 10:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490320#M101913</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-11-01T10:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490328#M101914</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you ever try to use `Exists()` func? Have a look at below doc:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordFunctions/Exists.htm#:~:text=Exists%20%28%29%20determines%20whether%20a%20specific%20field%20value,of%20a%20LOAD%20statement%20or%20an%20IF%20statement." target="_blank"&gt;Exists - script function | Qlik Sense on Windows Help&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ramazan&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 11:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490328#M101914</guid>
      <dc:creator>ramazanerduran</dc:creator>
      <dc:date>2024-11-01T11:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490395#M101925</link>
      <description>&lt;P&gt;Thank you again!&lt;BR /&gt;This is what I needed!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 19:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490395#M101925</guid>
      <dc:creator>DEMONIO_AZUL</dc:creator>
      <dc:date>2024-11-01T19:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490954#M102037</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I forgot to mention that this is what I needed...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DEMONIO_AZUL_0-1730843460854.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173860iB23CCA1FB433A259/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DEMONIO_AZUL_0-1730843460854.png" alt="DEMONIO_AZUL_0-1730843460854.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The flag was not what I wanted. I left it here just to show I did test it... I needed one or two or as many dimensions (&lt;FONT color="#FF9900"&gt;Found1&lt;/FONT&gt;, &lt;FONT color="#FF9900"&gt;Found2&lt;/FONT&gt;...etc) as needed to show what packages were included in &lt;FONT color="#FF9900"&gt;Purchased&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;But definitely, without your help I wouldn't have been able to sort this out. Thanks again.&lt;BR /&gt;&lt;BR /&gt;The desired result is the two columns shown:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DEMONIO_AZUL_1-1730843646206.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173861iCD51D5F9898377C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DEMONIO_AZUL_1-1730843646206.png" alt="DEMONIO_AZUL_1-1730843646206.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The &lt;FONT color="#0000FF"&gt;mapping LOAD&lt;/FONT&gt; effectively finds the occurrences of each &lt;FONT color="#FF9900"&gt;Package&lt;/FONT&gt; in &lt;FONT color="#FF9900"&gt;Purchased&lt;/FONT&gt;, but the &lt;FONT color="#0000FF"&gt;textbetween&lt;/FONT&gt; function only find the first occurrence, so I created a second dimension.&lt;/P&gt;
&lt;P&gt;Interesting would be to know if there's a way to get both Found1 and Found2 in just one dimension from the &lt;FONT color="#FF9900"&gt;Mapped&lt;/FONT&gt; text that already has all occurrences between &lt;FONT color="#008000"&gt;&amp;lt;&amp;gt;&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 22:01:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2490954#M102037</guid>
      <dc:creator>DEMONIO_AZUL</dc:creator>
      <dc:date>2024-11-05T22:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2491107#M102050</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/295559"&gt;@DEMONIO_AZUL&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;packages:
mapping load packages,
             '&amp;lt;' &amp;amp; packages &amp;amp; '&amp;gt;' as max_text;
Load * Inline [
packages
A1
X3
W6
H8 ];

Sales:
Load *,
     MapSubString('packages',Purchased) as Mapped_Purchased,
     SubStringCount(MapSubString('packages',Purchased),'&amp;lt;') as text_cnt;
Load * Inline [
SaleN0, Purchased
721,    A1,,,,
5,    X3;;; H8::: Z7 asdfghjkl Q4
36,    A1;; .. W6 fgdshg H8
807,    Sawtfcd hgfd kkklg sddfd
15, ssdfd X3 gfgdddljj poiigvf C5 H7 V2
205, H8.cvc hbbb A1 ];

max_text_cnt:
Load max(FieldValue('text_cnt',RecNo())) as max_text_cnt
AutoGenerate FieldValueCount('text_cnt');

let vMax_Cnt = Peek('max_text_cnt');

Drop Table max_text_cnt;

formula:
Load Concat(formula &amp;amp;' '&amp;amp; if(No=$(vMax_Cnt),'','&amp;amp; '',''&amp;amp; '),chr(10)) as formula;
Load 'Textbetween(Mapped_Purchased,''&amp;lt;'',''&amp;gt;'',' &amp;amp; IterNo() &amp;amp; ')' as formula,
      IterNo() as No
AutoGenerate 1
while IterNo()&amp;lt;=$(vMax_Cnt);

let vTextBetweenFormula = Peek('formula');

Drop Table formula;

Drop Field text_cnt;

sales_final:
Load *,
     if(len(trim(Found))=0,'Not found',Found) as Found_Final;
Load *,
     Replace(trim(Replace($(vTextBetweenFormula),',',' ')),' ',',') as Found
Resident Sales;

Drop Table Sales;

Drop Fields Found,Mapped_Purchased;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-06 at 12.26.27.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173906i4223C57E69FDE018/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-06 at 12.26.27.png" alt="Screenshot 2024-11-06 at 12.26.27.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 12:28:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2491107#M102050</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-11-06T12:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Search data of Table1 in Table2</title>
      <link>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2491123#M102052</link>
      <description>&lt;P&gt;This is AWESOME! Thanks again,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 13:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Search-data-of-Table1-in-Table2/m-p/2491123#M102052</guid>
      <dc:creator>DEMONIO_AZUL</dc:creator>
      <dc:date>2024-11-06T13:10:35Z</dc:date>
    </item>
  </channel>
</rss>

