<?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: Data Model producing multiple records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857698#M1215963</link>
    <description>&lt;P&gt;Sample file attached, thanks&lt;/P&gt;</description>
    <pubDate>Wed, 10 Nov 2021 14:02:36 GMT</pubDate>
    <dc:creator>cbaqir</dc:creator>
    <dc:date>2021-11-10T14:02:36Z</dc:date>
    <item>
      <title>Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857371#M1215959</link>
      <description>&lt;P&gt;I am trying to do a sum of a field in the EHRG_TICKET table called TOT_EST_PROD_BUILD_HRS. If I have one Ticket selected like 72, it is multiplying it x times (in this case 10).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=sum(TOT_EST_PROD_BUILD_HRS) = 110&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;but it should be only 11&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;My app is returning multiple rows when the source table has only one. I believe it is a data model issue but I do not know how to fix it. None of thee joined tables returns 10 rows so I am not sure where the issue is.&lt;/P&gt;
&lt;P&gt;EHRG_TICKET is the main table and has one row per DEFECT_ID in the database. However, I can see multiple rows in the preview and I believe this is due to the joins to the other table. How can I fix it when I still need the other tables?&lt;/P&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="2021-11-09_13-53-57.jpg" style="width: 447px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66316iC50DC04BD7A19FD8/image-dimensions/447x273?v=v2" width="447" height="273" role="button" title="2021-11-09_13-53-57.jpg" alt="2021-11-09_13-53-57.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-11-09_13-50-06.jpg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66315i58DB369CFF400161/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-09_13-50-06.jpg" alt="2021-11-09_13-50-06.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 14:03:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857371#M1215959</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2021-11-10T14:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857437#M1215962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/44206"&gt;@cbaqir&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I can sense that there is one table in the model which makes the many to many join result into multiple lines in the data.&lt;/P&gt;
&lt;P&gt;Is it possible to share the sample data for each table to check at my side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 03:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857437#M1215962</guid>
      <dc:creator>abhijitnalekar</dc:creator>
      <dc:date>2021-11-10T03:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857698#M1215963</link>
      <description>&lt;P&gt;Sample file attached, thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 14:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1857698#M1215963</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2021-11-10T14:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858221#M1215983</link>
      <description>&lt;P&gt;I cannot figure out where the issue is. Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 14:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858221#M1215983</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2021-11-11T14:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858334#M1215989</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;these two lines of your script multiply the records of your EHRG_TICKET table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;subfield(BUILD_RESOURCES,';') as BUILD_RESOURCES_SUB,
SubField("DESIGN_GROUPS",';') as DESIGN_GROUPS_SUB,&lt;/LI-CODE&gt;
&lt;P&gt;In your example they generate 5 x 2 = 10 multiples of the row DEFECT_ID=72 having&amp;nbsp;TOT_EST_PROD_BUILD_HRS =11, so&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sum( TOT_EST_PROD_BUILD_HRS)&lt;/LI-CODE&gt;
&lt;P&gt;will return 10 x 11 = 110 instead of just 11.&lt;/P&gt;
&lt;P&gt;Try extracting the subfields in separate tables instead in subsequent resident loads.&lt;/P&gt;
&lt;P&gt;See also:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/StringFunctions/SubField.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/StringFunctions/SubField.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_1-1636652037720.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66490i60CBC851017FAA64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoWedel_1-1636652037720.png" alt="MarcoWedel_1-1636652037720.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 17:34:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858334#M1215989</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2021-11-11T17:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858336#M1215990</link>
      <description>&lt;P&gt;Thank you! I will look into this.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 17:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858336#M1215990</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2021-11-11T17:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858348#M1215993</link>
      <description>&lt;P&gt;Do I need multiple Resident loads?&lt;/P&gt;
&lt;P&gt;If I run this, I lose all of the other fields from the Resident table I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SepNames: //Needed to prevent duplicate records CB 11/11/21&lt;/P&gt;
&lt;P&gt;Load DEFECT_ID,TAGS_GOALS,DEFINE_BODIES,DESIGN_GROUPS,BUILD_RESOURCES,TAGS_TICKET_TRACKING,NAT_CLINIC_INFORM,&lt;/P&gt;
&lt;P&gt;subfield("TAGS_GOALS",';') as TAGS_GOALS_SUB,&lt;/P&gt;
&lt;P&gt;SubField("DEFINE_BODIES",';') as DEFINE_BODIES_SUB, //CB 6/17/20&lt;BR /&gt;SubField("DESIGN_GROUPS",';') as DESIGN_GROUPS_SUB,//CB 6/17/20&lt;BR /&gt;subfield(BUILD_RESOURCES,';') as BUILD_RESOURCES_SUB,&lt;BR /&gt;subfield("TAGS_TICKET_TRACKING",';') as TAGS_TICKET_TRACKING_SUB,&lt;BR /&gt;subfield("NAT_CLINIC_INFORM",';') as NAT_CLINIC_INFORM_SUB&lt;/P&gt;
&lt;P&gt;Resident RPT_EHRG_TICKET;&lt;BR /&gt;Drop Table RPT_EHRG_TICKET;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 18:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858348#M1215993</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2021-11-11T18:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model producing multiple records</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858420#M1215997</link>
      <description>&lt;P&gt;Just delete the subfield() rows from your&amp;nbsp;&lt;SPAN&gt;EHRG_TICKET load and afterwards create the "Sub" fields in additional tables associated with the&amp;nbsp;EHRG_TICKET table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For the examples of "BUILD_RESOURCES_SUB" and "DESIGN_GROUPS_SUB" this could look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;tabBuildResourcesSub:
LOAD Distinct
     BUILD_RESOURCES,
     SubField(BUILD_RESOURCES,';') as BUILD_RESOURCES_SUB
Resident EHRG_TICKET;

tabDesignGroupsSub:
LOAD Distinct
     DESIGN_GROUPS,
     SubField(DESIGN_GROUPS,';') as DESIGN_GROUPS_SUB
Resident EHRG_TICKET;
&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="MarcoWedel_0-1636666024137.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66511iDE1AEAC6CB880911/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoWedel_0-1636666024137.png" alt="MarcoWedel_0-1636666024137.png" /&gt;&lt;/span&gt;&lt;/P&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="MarcoWedel_1-1636666083049.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66512iF81108F4793D76D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoWedel_1-1636666083049.png" alt="MarcoWedel_1-1636666083049.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;Marco&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>Thu, 11 Nov 2021 21:29:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-producing-multiple-records/m-p/1858420#M1215997</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2021-11-11T21:29:42Z</dc:date>
    </item>
  </channel>
</rss>

