<?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: Build a hierarchy with additional information on the link between two columns (or another solution other than with a hierarchy) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Build-a-hierarchy-with-additional-information-on-the-link/m-p/2475511#M100152</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/157186"&gt;@Obsyky&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;is this what you are looking for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//If your LinkTable contains the fields From, To, LinkDate&lt;/P&gt;
&lt;P&gt;//and your GenderTable contains the fields Start, End&lt;/P&gt;
&lt;P&gt;//create a path table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PathTable:&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;Start AS CurrentNode,&lt;BR /&gt;'' AS Path,&lt;BR /&gt;Date('01/01/1900') AS MaxLinkDate&lt;BR /&gt;RESIDENT GenderTable;&lt;/P&gt;
&lt;P&gt;LET vContinue = 1;&lt;/P&gt;
&lt;P&gt;DO WHILE $(vContinue)&lt;BR /&gt;LEFT JOIN (PathTable)&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;From AS CurrentNode,&lt;BR /&gt;Max(LinkDate) AS MaxLinkDate&lt;BR /&gt;RESIDENT LinkTable&lt;BR /&gt;WHERE EXISTS(CurrentNode, To)&lt;BR /&gt;GROUP BY Start, End, From;&lt;/P&gt;
&lt;P&gt;JOIN (PathTable)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;From AS CurrentNode,&lt;BR /&gt;From &amp;amp; '-' &amp;amp; CurrentNode AS Path&lt;BR /&gt;RESIDENT LinkTable&lt;BR /&gt;WHERE EXISTS(CurrentNode, To);&lt;/P&gt;
&lt;P&gt;LET vContinue = NoOfRows('PathTable') - NoOfRows('GenderTable');&lt;BR /&gt;LOOP&lt;/P&gt;
&lt;P&gt;DROP FIELD CurrentNode;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Calculate the maximum link date for each pair in the gender table&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;Date(Max(MaxLinkDate)) AS MaxLinkDate&lt;BR /&gt;RESIDENT PathTable&lt;BR /&gt;GROUP BY Start, End;&lt;/P&gt;
&lt;P&gt;DROP TABLE PathTable;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2024 10:53:16 GMT</pubDate>
    <dc:creator>F_B</dc:creator>
    <dc:date>2024-08-09T10:53:16Z</dc:date>
    <item>
      <title>Build a hierarchy with additional information on the link between two columns (or another solution other than with a hierarchy)</title>
      <link>https://community.qlik.com/t5/App-Development/Build-a-hierarchy-with-additional-information-on-the-link/m-p/2455971#M98472</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'd like to explain what I mean.&lt;/P&gt;
&lt;P&gt;I have a table of links between objects that can tell me the date on which the link was created. I want to build a hierarchy where I can find out the date of the link between each level of hierarchy.&lt;/P&gt;
&lt;P&gt;The ultimate goal (if other solutions are possible) is to be able to know the maximum link date between two levels.&lt;/P&gt;
&lt;P&gt;I'll give an example:&lt;/P&gt;
&lt;P&gt;Link table :&lt;/P&gt;
&lt;TABLE border="1" width="42.092154420921545%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;B1&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;15/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;B1&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;C1&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;14/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;C1&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;D1&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;16/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;A2&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;B1&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;13/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;A3&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;B3&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;19/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="25px"&gt;B3&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="25px"&gt;C1&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="25px"&gt;20/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="49px"&gt;A1&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="49px"&gt;B4&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="49px"&gt;05/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%" height="49px"&gt;B4&lt;/TD&gt;
&lt;TD width="14.40431714404317%" height="49px"&gt;C4&lt;/TD&gt;
&lt;TD width="17.26857617268577%" height="49px"&gt;06/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10.419261104192614%"&gt;C4&lt;/TD&gt;
&lt;TD width="14.40431714404317%"&gt;D1&lt;/TD&gt;
&lt;TD width="17.26857617268577%"&gt;07/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then have a gender table which tells me between whom and whom I should look for the max date:&lt;/P&gt;
&lt;TABLE border="1" width="30.635118306351185%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;B1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;D1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;A2&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;C1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;B3&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;D1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;C4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;B4&lt;/TD&gt;
&lt;TD width="1.2453300124532998%" height="25px"&gt;D1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what I would like at the end is this :&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;A1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;B1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;15/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;D1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;16/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;C1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;14/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;B3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;D1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;20/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;A1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;C4&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;06/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;B4&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;D1&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;07/05/2024&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the slightest solution to my problem, I'll be incredibly grateful.TY&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 08:15:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Build-a-hierarchy-with-additional-information-on-the-link/m-p/2455971#M98472</guid>
      <dc:creator>Obsyky</dc:creator>
      <dc:date>2024-05-24T08:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Build a hierarchy with additional information on the link between two columns (or another solution other than with a hierarchy)</title>
      <link>https://community.qlik.com/t5/App-Development/Build-a-hierarchy-with-additional-information-on-the-link/m-p/2475511#M100152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/157186"&gt;@Obsyky&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;is this what you are looking for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//If your LinkTable contains the fields From, To, LinkDate&lt;/P&gt;
&lt;P&gt;//and your GenderTable contains the fields Start, End&lt;/P&gt;
&lt;P&gt;//create a path table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PathTable:&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;Start AS CurrentNode,&lt;BR /&gt;'' AS Path,&lt;BR /&gt;Date('01/01/1900') AS MaxLinkDate&lt;BR /&gt;RESIDENT GenderTable;&lt;/P&gt;
&lt;P&gt;LET vContinue = 1;&lt;/P&gt;
&lt;P&gt;DO WHILE $(vContinue)&lt;BR /&gt;LEFT JOIN (PathTable)&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;From AS CurrentNode,&lt;BR /&gt;Max(LinkDate) AS MaxLinkDate&lt;BR /&gt;RESIDENT LinkTable&lt;BR /&gt;WHERE EXISTS(CurrentNode, To)&lt;BR /&gt;GROUP BY Start, End, From;&lt;/P&gt;
&lt;P&gt;JOIN (PathTable)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;From AS CurrentNode,&lt;BR /&gt;From &amp;amp; '-' &amp;amp; CurrentNode AS Path&lt;BR /&gt;RESIDENT LinkTable&lt;BR /&gt;WHERE EXISTS(CurrentNode, To);&lt;/P&gt;
&lt;P&gt;LET vContinue = NoOfRows('PathTable') - NoOfRows('GenderTable');&lt;BR /&gt;LOOP&lt;/P&gt;
&lt;P&gt;DROP FIELD CurrentNode;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Calculate the maximum link date for each pair in the gender table&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;BR /&gt;LOAD&lt;BR /&gt;Start,&lt;BR /&gt;End,&lt;BR /&gt;Date(Max(MaxLinkDate)) AS MaxLinkDate&lt;BR /&gt;RESIDENT PathTable&lt;BR /&gt;GROUP BY Start, End;&lt;/P&gt;
&lt;P&gt;DROP TABLE PathTable;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 10:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Build-a-hierarchy-with-additional-information-on-the-link/m-p/2475511#M100152</guid>
      <dc:creator>F_B</dc:creator>
      <dc:date>2024-08-09T10:53:16Z</dc:date>
    </item>
  </channel>
</rss>

