<?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 Text() function on fields with leading zeros causing bad associations in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Text-function-on-fields-with-leading-zeros-causing-bad/m-p/1199241#M22658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I have a problem with one field across multiple tables: Cust-no.&amp;nbsp; In the database, this field is a varchar array so there are often two separate customers that are numerically equivalent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Current example: 00020047 and 20047&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;These two customers have completely different profiles and associations with other tables.&amp;nbsp; I’ll keep this example simple and only explain the problems I’m having associating my customer table with my invoice table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Without making any adjustments to the LOAD script, all of the invoices are doubled, one for each customer.&amp;nbsp; Each customer is assigned the same Cust-no: 00020047. 20047 disappears.&amp;nbsp; This is problematic across all tables as each invoice in this scenario shows as having two different customers: &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;IMG alt="table1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/142373_table1.png" style="height: 302px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I’ve tried to resolve this using text() in the load script.&amp;nbsp; I put it in both tables, customer only, and invoice only with the following results:&lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Both tables:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Invoice table &amp;gt; text("Invoice.Cust-no") AS "Cust-no",&amp;nbsp; (this loads from a qualified QVD)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Customer table &amp;gt; text("Cust-no") AS "Cust-no",&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;This appears to work at first, creating two separate customers with two different Cust-nos. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;However, the association fails.&amp;nbsp; All the invoices for 20047 belong to 00020047.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;This is inaccurate as 20047 is the Cust-no on many of the Document numbers.&amp;nbsp; 20047 shows as having no invoices. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;IMG alt="table2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/142374_table2.png" style="height: 213px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Using the text() function on only the invoice table yields the same results. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Using text() on only the customer table breaks the association completely.&amp;nbsp; Both 20047 and 00020047 have no invoices associated with them.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Is there anything I can do in the select statement or some other function that I could use in the preceding load to force the Cust-no the be a string without breaking the association to other tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2016 13:35:19 GMT</pubDate>
    <dc:creator>sstefancies</dc:creator>
    <dc:date>2016-10-28T13:35:19Z</dc:date>
    <item>
      <title>Text() function on fields with leading zeros causing bad associations</title>
      <link>https://community.qlik.com/t5/App-Development/Text-function-on-fields-with-leading-zeros-causing-bad/m-p/1199241#M22658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I have a problem with one field across multiple tables: Cust-no.&amp;nbsp; In the database, this field is a varchar array so there are often two separate customers that are numerically equivalent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Current example: 00020047 and 20047&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;These two customers have completely different profiles and associations with other tables.&amp;nbsp; I’ll keep this example simple and only explain the problems I’m having associating my customer table with my invoice table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Without making any adjustments to the LOAD script, all of the invoices are doubled, one for each customer.&amp;nbsp; Each customer is assigned the same Cust-no: 00020047. 20047 disappears.&amp;nbsp; This is problematic across all tables as each invoice in this scenario shows as having two different customers: &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;IMG alt="table1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/142373_table1.png" style="height: 302px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I’ve tried to resolve this using text() in the load script.&amp;nbsp; I put it in both tables, customer only, and invoice only with the following results:&lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Both tables:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Invoice table &amp;gt; text("Invoice.Cust-no") AS "Cust-no",&amp;nbsp; (this loads from a qualified QVD)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Customer table &amp;gt; text("Cust-no") AS "Cust-no",&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;This appears to work at first, creating two separate customers with two different Cust-nos. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;However, the association fails.&amp;nbsp; All the invoices for 20047 belong to 00020047.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;This is inaccurate as 20047 is the Cust-no on many of the Document numbers.&amp;nbsp; 20047 shows as having no invoices. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;IMG alt="table2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/142374_table2.png" style="height: 213px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Using the text() function on only the invoice table yields the same results. &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Using text() on only the customer table breaks the association completely.&amp;nbsp; Both 20047 and 00020047 have no invoices associated with them.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Is there anything I can do in the select statement or some other function that I could use in the preceding load to force the Cust-no the be a string without breaking the association to other tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 13:35:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Text-function-on-fields-with-leading-zeros-causing-bad/m-p/1199241#M22658</guid>
      <dc:creator>sstefancies</dc:creator>
      <dc:date>2016-10-28T13:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Text() function on fields with leading zeros causing bad associations</title>
      <link>https://community.qlik.com/t5/App-Development/Text-function-on-fields-with-leading-zeros-causing-bad/m-p/1199242#M22659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to resolve this problem by eliminating QVDs from my data model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 17:24:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Text-function-on-fields-with-leading-zeros-causing-bad/m-p/1199242#M22659</guid>
      <dc:creator>sstefancies</dc:creator>
      <dc:date>2016-11-22T17:24:53Z</dc:date>
    </item>
  </channel>
</rss>

