<?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: Join table on partial product code? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152883#M93370</link>
    <description>&lt;P&gt;IF every code is always 42 characters and the rest of the characters remain the same, you could use Left() Right() and Mid() functions to break down that longer key into smaller keys.&lt;/P&gt;
&lt;P&gt;In your example, "111", "222" and "333" are the same, so you could create a key with the value "111222333" and use that value to link between the tables, for example by using&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Left('111???222333', 3) &amp;amp; Right('111???222333', 6) AS JoinKey,&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;The idea is that both fields can get to a value that is unique in both tables that will allow for the JOIN.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 08:15:27 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2023-12-14T08:15:27Z</dc:date>
    <item>
      <title>Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152753#M93363</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have one table with product codes that are missing parts of the code.&lt;/P&gt;
&lt;P&gt;The product codes are always 42 characters.&lt;/P&gt;
&lt;P&gt;The missing parts are identified by '?' characters (can easily be changed to another character).&lt;/P&gt;
&lt;P&gt;The product codes are all numeric.&lt;/P&gt;
&lt;P&gt;I have a second table of complete product codes (no ? s)&lt;/P&gt;
&lt;P&gt;How can I join the two in a one to many relationship where a product code like 111???222333 would join up to products 111555222333, 111777222333, 111000222333, etc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for any assistance. I assume I need to use wildmatch somehow.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am also OK with creating a master dimension if that works better.&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, 13 Dec 2023 22:32:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152753#M93363</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2023-12-13T22:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152883#M93370</link>
      <description>&lt;P&gt;IF every code is always 42 characters and the rest of the characters remain the same, you could use Left() Right() and Mid() functions to break down that longer key into smaller keys.&lt;/P&gt;
&lt;P&gt;In your example, "111", "222" and "333" are the same, so you could create a key with the value "111222333" and use that value to link between the tables, for example by using&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Left('111???222333', 3) &amp;amp; Right('111???222333', 6) AS JoinKey,&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;The idea is that both fields can get to a value that is unique in both tables that will allow for the JOIN.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:15:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152883#M93370</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2023-12-14T08:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152911#M93375</link>
      <description>&lt;P&gt;You can maybe use intervalmatch.&lt;BR /&gt;In your first table, create 2 new fields, MinProductCode and MaxProductCode, for the first one you replace all ? with 0, in the second one, you replace all ? with 9.&lt;BR /&gt;You will end up with something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1" width="63.9993481095176%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;ProductCode&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;MinProductCode&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;MaxProductCode&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;otherFields...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111???222333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111&lt;STRONG&gt;000&lt;/STRONG&gt;222333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111&lt;STRONG&gt;999&lt;/STRONG&gt;222333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111123??2333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111123&lt;STRONG&gt;00&lt;/STRONG&gt;2333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&lt;SPAN&gt;111123&lt;STRONG&gt;99&lt;/STRONG&gt;2333&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;...&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then, you can use intervalmatch to join this table with the reference table of products.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:51:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2152911#M93375</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-12-14T08:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153042#M93391</link>
      <description>&lt;P&gt;Thank you Vincent. Interesting idea. I think it might give me too many results though. There can be multiple groups of ??? in the product code and if one occurred early in the string it would give a huge set of results between the two 000 - 999.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I need to do this in SQL with a 'like' in the join or a subquery?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:43:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153042#M93391</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2023-12-14T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153055#M93393</link>
      <description>&lt;P&gt;Ah ok, I see, you want only the same number. For example '???' should replace 000, 111, 222... but not 123, right?&lt;BR /&gt;Could you have a single '?', or multiple? Or always 3?&lt;BR /&gt;Could you have '?' at different places (like 12?34??6778) or always grouped together?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:08:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153055#M93393</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-12-14T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153076#M93398</link>
      <description>&lt;P&gt;Hello Vincent,&lt;/P&gt;
&lt;P&gt;Always in groups of three. Could be any three numbers replacing the three ???.&lt;/P&gt;
&lt;P&gt;I tried this method that did not work. I thought I could then run through the table and eliminate items with no wildmatch. The field MatchingCodes was 0 for all records.&lt;/P&gt;
&lt;DIV&gt;[ProductBridgeTemp]:&lt;/DIV&gt;
&lt;DIV&gt;LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;EUProductCode&amp;nbsp; &amp;nbsp;//This code has the ??? parts in it&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT EUParts;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;OUTER JOIN (ProductBridgeTemp)&lt;/DIV&gt;
&lt;DIV&gt;LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ProductCodeNK //Complete codes...no ??? parts in them&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT USProducts;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;[ProductBridge]:&lt;/DIV&gt;
&lt;DIV&gt;NOCONCATENATE LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ProductCodeNK,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; EUProductCode,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; WILDMATCH(ProductCodeNK,PEEK(EUProductCode,0)) as MatchingCodes&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT ProductBridgeTemp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;DROP TABLE ProductBridgeTemp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153076#M93398</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2023-12-14T13:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153105#M93400</link>
      <description>&lt;P&gt;I'm still thinking that intervalmatch can... match.&lt;/P&gt;
&lt;P&gt;Of course you have thousand possible values between 000 and 999. &lt;BR /&gt;However, do you really have thousand products with a code between&amp;nbsp;&lt;SPAN&gt;111&lt;/SPAN&gt;&lt;STRONG&gt;000&lt;/STRONG&gt;&lt;SPAN&gt;222333 and&amp;nbsp;111&lt;STRONG&gt;999&lt;/STRONG&gt;222333?&lt;BR /&gt;And, if this is the case, how could you decide which ones are matching with&amp;nbsp;111&lt;STRONG&gt;???&lt;/STRONG&gt;222333, if I understand well, all of them should match.&lt;BR /&gt;And if you have only 10 products in this interval, only those 10 will be linked to your first table.&lt;BR /&gt;You can create a link table in between, your first table will still contents&amp;nbsp;111&lt;STRONG&gt;???&lt;/STRONG&gt;222333, the product reference table&amp;nbsp;111&lt;STRONG&gt;456&lt;/STRONG&gt;222333 and the link table&amp;nbsp;111&lt;STRONG&gt;???&lt;/STRONG&gt;222333 and&amp;nbsp;111&lt;STRONG&gt;456&lt;/STRONG&gt;222333.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153105#M93400</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-12-14T14:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join table on partial product code?</title>
      <link>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153107#M93401</link>
      <description>&lt;P&gt;After some banging about, this seems to have worked. I had a problem with my original PEEK statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;[ProductBridgeTemp]:&lt;/DIV&gt;
&lt;DIV&gt;LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; EUProductCode&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT EUParts;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;OUTER JOIN (ProductBridgeTemp)&lt;/DIV&gt;
&lt;DIV&gt;LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ProductCodeNK&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT USProducts;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;[ProductBridgeTemp1]:&lt;/DIV&gt;
&lt;DIV&gt;NOCONCATENATE LOAD DISTINCT&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ProductCodeNK,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; EUProductCode,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; WILDMATCH(ProductCodeNK,PEEK(EUProductCode,RowNo(),'ProductBridgeTemp')) as MatchingCodes&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT ProductBridgeTemp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;[ProductBridge]:&lt;/DIV&gt;
&lt;DIV&gt;NOCONCATENATE LOAD&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ProductCodeNK,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; EUProductCode&lt;/DIV&gt;
&lt;DIV&gt;RESIDENT ProductBridgeTemp1&lt;/DIV&gt;
&lt;DIV&gt;WHERE MatchingCodes=1;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;DROP TABLE ProductBridgeTemp, ProductBridgeTemp1;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:45:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-table-on-partial-product-code/m-p/2153107#M93401</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2023-12-14T14:45:26Z</dc:date>
    </item>
  </channel>
</rss>

