<?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: Product tree without empty nodes in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029698#M84823</link>
    <description>&lt;P&gt;just add product to the hierarchy table, but you still need product dimension from fact table to aggregate on in the pivot table&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="vinieme12_0-1674634154187.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98788iCFD4E99FA827A68E/image-size/large?v=v2&amp;amp;px=999" role="button" title="vinieme12_0-1674634154187.png" alt="vinieme12_0-1674634154187.png" /&gt;&lt;/span&gt;&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;
&lt;LI-CODE lang="markup"&gt;hierarchy:
CrossTable(levels,level, 1)
load product,level1,level2,level3 , product
Resident temp;&lt;/LI-CODE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 08:09:23 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2023-01-25T08:09:23Z</dc:date>
    <item>
      <title>Product tree without empty nodes</title>
      <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029201#M84790</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I'm using a product tree with many levels which aren't all filled in for all the products. Some products have all levels, others have only a few.&lt;/P&gt;
&lt;P&gt;Something like this where only product 1 had all levels and the others don't.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristof_j_0-1674553779528.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98686i9E2BBC9356BFE402/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kristof_j_0-1674553779528.png" alt="kristof_j_0-1674553779528.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If i make a pivot table it's messy. The products which don't have all&amp;nbsp; levels show empty values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristof_j_1-1674553844665.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98687i1EABD92FA4FC5FB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kristof_j_1-1674553844665.png" alt="kristof_j_1-1674553844665.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a way to remove these empty values? With a calculated dimension?&lt;/P&gt;
&lt;P&gt;In real life the product tree is a table linked to the sales. So the yellow marked values are null values.&lt;/P&gt;
&lt;P&gt;Test data used for this example:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load * Inline [&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;clients, product, level1, level2, level3&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;11, 1, a, aa, aaa&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;22, 2, b, bb,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;33, 3, c,,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;44, 4, a, AA&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;55, 5, a, &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 09:55:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029201#M84790</guid>
      <dc:creator>kristof_j</dc:creator>
      <dc:date>2023-01-24T09:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Product tree without empty nodes</title>
      <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029643#M84813</link>
      <description>&lt;P&gt;create a hierarchy table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vinieme12_0-1674618924663.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98778i65AEFBB676D501DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vinieme12_0-1674618924663.png" alt="vinieme12_0-1674618924663.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;temp:
Load clients,product,if(len(trim(level1))&amp;lt;1,null(),level1) as level1 ,if(len(trim(level2))&amp;lt;1,null(),level2) as level2,if(len(trim(level3))&amp;lt;1,null(),level3) as level3 Inline [
clients,product,level1,level2,level3
11,1,a,aa,aaa
22,2,b,bb,
33,3,c,,
44,4,a,AA
55,5,a,
];

hierarchy:
CrossTable(levels,level, 1)
load clients,level1,level2,level3 
Resident temp;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 03:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029643#M84813</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2023-01-25T03:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Product tree without empty nodes</title>
      <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029688#M84822</link>
      <description>&lt;P&gt;Thx but it needs to be the other way around. In your solution the product is the start of the tree but it should be the end. Otherwise you don't have an overview of the tree itself. In my example you can see that level1-a has 110 clients. In your example you don't have that kind of information.&lt;/P&gt;
&lt;P&gt;The product tree is about 12.000 products long and 9 levels deep. But as in the example, some products end at level 9 and other at level 3 ... So the products that end at level 3 don't need to show the other empty levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 07:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029688#M84822</guid>
      <dc:creator>kristof_j</dc:creator>
      <dc:date>2023-01-25T07:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Product tree without empty nodes</title>
      <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029698#M84823</link>
      <description>&lt;P&gt;just add product to the hierarchy table, but you still need product dimension from fact table to aggregate on in the pivot table&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="vinieme12_0-1674634154187.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98788iCFD4E99FA827A68E/image-size/large?v=v2&amp;amp;px=999" role="button" title="vinieme12_0-1674634154187.png" alt="vinieme12_0-1674634154187.png" /&gt;&lt;/span&gt;&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;
&lt;LI-CODE lang="markup"&gt;hierarchy:
CrossTable(levels,level, 1)
load product,level1,level2,level3 , product
Resident temp;&lt;/LI-CODE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 08:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029698#M84823</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2023-01-25T08:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Product tree without empty nodes</title>
      <link>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029747#M84827</link>
      <description>&lt;P&gt;I guess I don't understand your solution.&lt;/P&gt;
&lt;P&gt;In your visualization you can't see the tree. You don't know how many clients are in product group 'a'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can switch the dimensions so I can see how many clients have product group 'a' but then I don't know anymore that 'aa' falls under 'a'.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristof_j_0-1674636623585.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98802i8986E124CC2AD0A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kristof_j_0-1674636623585.png" alt="kristof_j_0-1674636623585.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;A drill down like a pivot table is going to be necessary as the product tree is very large.&lt;BR /&gt;Starting at a high level and drilling down to lower levels if necessary. Sometimes selection a product group and get an overview of all the underlying products (as in my first screenshot).&lt;/P&gt;
&lt;P&gt;I managed to solves this in QlikView with an expression but not in Qlik Sense.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a new field&lt;/P&gt;
&lt;P&gt;temp:&lt;BR /&gt;Load clients,&lt;BR /&gt;product,&lt;BR /&gt;level_no,&lt;BR /&gt;if(len(trim(level1))&amp;lt;1,null(),level1) as level1 ,&lt;BR /&gt;if(len(trim(level2))&amp;lt;1,null(),level2) as level2,&lt;BR /&gt;if(len(trim(level3))&amp;lt;1,null(),level3) as level3 &lt;BR /&gt;Inline [&lt;BR /&gt;clients,product,level1,level2,level3, level_no&lt;BR /&gt;11,1,a,aa,aaa,3&lt;BR /&gt;22,2,b,bb,,2&lt;BR /&gt;33,3,c,,,1&lt;BR /&gt;44,4,a,AA,,2&lt;BR /&gt;55,5,a,,,1&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Supressing dimensions when values are null.&amp;nbsp;&lt;BR /&gt;And this expression:&amp;nbsp;if( max(num#(level_no), '0') &amp;gt;= Dimensionality(), sum(clients))&lt;/P&gt;
&lt;P&gt;The expressions isn't completely correct but with a count(distinct clientnumber) it should be fine.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristof_j_1-1674637440221.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98804i1FC3ECC8B70BA514/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kristof_j_1-1674637440221.png" alt="kristof_j_1-1674637440221.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I do the same in QS I get this&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristof_j_2-1674637708837.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98805i0966F7DB2DB0B4ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kristof_j_2-1674637708837.png" alt="kristof_j_2-1674637708837.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 09:08:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Product-tree-without-empty-nodes/m-p/2029747#M84827</guid>
      <dc:creator>kristof_j</dc:creator>
      <dc:date>2023-01-25T09:08:49Z</dc:date>
    </item>
  </channel>
</rss>

