<?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 Foreign key, primary key association issue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Foreign-key-primary-key-association-issue/m-p/1672614#M50919</link>
    <description>&lt;P&gt;Hello all, apologies in advance if this is super elementary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table and dimension table associated by fk/pk. The key in this case is a combination of numeric codes that we use to distribute expenses to the correct business unit/site/department/expense type. The dimension table contains&amp;nbsp; the individual segments of each combination. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dimension.JPG" style="width: 402px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28000i62D61DF57065BF33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Dimension.JPG" alt="Dimension.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The issue: I created a table chart in Qlik Sense to view the data, and it does not appear to be associated properly. For rows in which I have a non-zero value in the 'DistributedAmount' field, the segment values are null. But in the rows where there is no DistributedAmount ($0, not null), I get the segment values. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chart.JPG" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28001iCF6C46D06935F771/image-size/large?v=v2&amp;amp;px=999" role="button" title="Chart.JPG" alt="Chart.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notable info:&lt;/P&gt;&lt;P&gt;- The present keys in the fact table represent only ~5% of the keys present in the dimension table&lt;/P&gt;&lt;P&gt;- The keys that do have a non-zero DistributionAmount are the ones that appear in the fact table&lt;/P&gt;&lt;P&gt;- The primary key is a derived field that concatenates all the segments to form the code combination&lt;/P&gt;&lt;P&gt;- In the load script, where I load the dimension table data, I have attempted to limit what is brought in by using 'WHERE EXISTS (CodeCombination,&amp;nbsp;SEGMENT1 &amp;amp; '-' &amp;amp; SEGMENT2 &amp;amp; '-' &amp;amp; SEGMENT3 &amp;amp; '-' &amp;amp; SEGMENT4 &amp;amp;'-'&amp;amp; SEGMENT5 &amp;amp;'-'&amp;amp; SEGMENT6)' -- which does eliminate the rows that contain code combinations that have zero DistributedAmount... however the corresponding segment values, for the code combinations that do have non-zero DistributedAmount, are still null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Your feedback is very much appreciated.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:10:16 GMT</pubDate>
    <dc:creator>chrisqlik</dc:creator>
    <dc:date>2024-11-16T19:10:16Z</dc:date>
    <item>
      <title>Foreign key, primary key association issue</title>
      <link>https://community.qlik.com/t5/App-Development/Foreign-key-primary-key-association-issue/m-p/1672614#M50919</link>
      <description>&lt;P&gt;Hello all, apologies in advance if this is super elementary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table and dimension table associated by fk/pk. The key in this case is a combination of numeric codes that we use to distribute expenses to the correct business unit/site/department/expense type. The dimension table contains&amp;nbsp; the individual segments of each combination. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dimension.JPG" style="width: 402px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28000i62D61DF57065BF33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Dimension.JPG" alt="Dimension.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The issue: I created a table chart in Qlik Sense to view the data, and it does not appear to be associated properly. For rows in which I have a non-zero value in the 'DistributedAmount' field, the segment values are null. But in the rows where there is no DistributedAmount ($0, not null), I get the segment values. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chart.JPG" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28001iCF6C46D06935F771/image-size/large?v=v2&amp;amp;px=999" role="button" title="Chart.JPG" alt="Chart.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notable info:&lt;/P&gt;&lt;P&gt;- The present keys in the fact table represent only ~5% of the keys present in the dimension table&lt;/P&gt;&lt;P&gt;- The keys that do have a non-zero DistributionAmount are the ones that appear in the fact table&lt;/P&gt;&lt;P&gt;- The primary key is a derived field that concatenates all the segments to form the code combination&lt;/P&gt;&lt;P&gt;- In the load script, where I load the dimension table data, I have attempted to limit what is brought in by using 'WHERE EXISTS (CodeCombination,&amp;nbsp;SEGMENT1 &amp;amp; '-' &amp;amp; SEGMENT2 &amp;amp; '-' &amp;amp; SEGMENT3 &amp;amp; '-' &amp;amp; SEGMENT4 &amp;amp;'-'&amp;amp; SEGMENT5 &amp;amp;'-'&amp;amp; SEGMENT6)' -- which does eliminate the rows that contain code combinations that have zero DistributedAmount... however the corresponding segment values, for the code combinations that do have non-zero DistributedAmount, are still null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Your feedback is very much appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:10:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Foreign-key-primary-key-association-issue/m-p/1672614#M50919</guid>
      <dc:creator>chrisqlik</dc:creator>
      <dc:date>2024-11-16T19:10:16Z</dc:date>
    </item>
  </channel>
</rss>

