<?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 Self-referencing table / Hierarchy / Pivot table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Self-referencing-table-Hierarchy-Pivot-table/m-p/1570983#M41858</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to build a data model with a table that references itself and I'm struggling to display this hierarchy in a Pivottable.&lt;/P&gt;&lt;P&gt;For example there is a field called projectID, then some measures like projectName, baseLineHours, planHours... , and a field parentID.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example of data model" style="width: 901px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10518iF7C451E32262FAAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="ex.PNG" alt="Example of data model" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Example of data model&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;So there is an hierarchical structure on the table. The parent itself is also a record within the table - so the values in parentID are a subset of the values in projectID.&lt;BR /&gt;&lt;BR /&gt;Only a few projects have a parentID and a parent can have multiple subprojects. But one subproject can't be a parent of another project, so the depth of the hierarchy is only 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hava already used the Hierarchy function to determine the subprojects to the parent (and vice versa) in an additional table und to add fields "isChild" and "isParent" to the original table (which is useful for a different diagram sheet).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I now want to display all parent Projects with all other dimensions and measures in an table (or pivot table) - and then will be able to click open and display the subprojects to a specific master project aswell. Just like it's possible with a pivot table.&lt;BR /&gt;The problem with this is, that the baselineHours or planHours of a Master aren't the sum of it's subprojects.&amp;nbsp;&lt;BR /&gt;So in the table, for the Master projects Qlik Sense should pick the row where the productID is the parentID, but otherwise just the ID of the subproject as usual.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'" style="width: 552px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10519i09C61E7CCC60171E/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Has anyone an idea how to do that? Maybe with an different approach in data model or&amp;nbsp; choice of the diagram.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!!&lt;BR /&gt;&lt;BR /&gt;Selina&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 11:50:54 GMT</pubDate>
    <dc:creator>SelinaM</dc:creator>
    <dc:date>2019-04-18T11:50:54Z</dc:date>
    <item>
      <title>Self-referencing table / Hierarchy / Pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Self-referencing-table-Hierarchy-Pivot-table/m-p/1570983#M41858</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to build a data model with a table that references itself and I'm struggling to display this hierarchy in a Pivottable.&lt;/P&gt;&lt;P&gt;For example there is a field called projectID, then some measures like projectName, baseLineHours, planHours... , and a field parentID.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example of data model" style="width: 901px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10518iF7C451E32262FAAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="ex.PNG" alt="Example of data model" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Example of data model&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;So there is an hierarchical structure on the table. The parent itself is also a record within the table - so the values in parentID are a subset of the values in projectID.&lt;BR /&gt;&lt;BR /&gt;Only a few projects have a parentID and a parent can have multiple subprojects. But one subproject can't be a parent of another project, so the depth of the hierarchy is only 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hava already used the Hierarchy function to determine the subprojects to the parent (and vice versa) in an additional table und to add fields "isChild" and "isParent" to the original table (which is useful for a different diagram sheet).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I now want to display all parent Projects with all other dimensions and measures in an table (or pivot table) - and then will be able to click open and display the subprojects to a specific master project aswell. Just like it's possible with a pivot table.&lt;BR /&gt;The problem with this is, that the baselineHours or planHours of a Master aren't the sum of it's subprojects.&amp;nbsp;&lt;BR /&gt;So in the table, for the Master projects Qlik Sense should pick the row where the productID is the parentID, but otherwise just the ID of the subproject as usual.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'" style="width: 552px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/10519i09C61E7CCC60171E/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The rows for K1 and M1 should now contain the respective records of K1 or M1 instead of the wrong record or '-'&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Has anyone an idea how to do that? Maybe with an different approach in data model or&amp;nbsp; choice of the diagram.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!!&lt;BR /&gt;&lt;BR /&gt;Selina&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 11:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Self-referencing-table-Hierarchy-Pivot-table/m-p/1570983#M41858</guid>
      <dc:creator>SelinaM</dc:creator>
      <dc:date>2019-04-18T11:50:54Z</dc:date>
    </item>
  </channel>
</rss>

