<?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 Two fields in the same table linked with another table. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279577#M1196891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer. I will try the code you provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I have 3 levels of users, and we will probably create other levels later&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2011 13:29:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-10T13:29:06Z</dc:date>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279572#M1196886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering how I could link two different fields of the same table to another table.&lt;/P&gt;&lt;P&gt;In my case, I have two tables: The table User, and the table UserHierarchy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table UserHierarchy contains the following fields: IdHierarchy, IdUser, IdUserChild. Both IdUser, IdUserChild refer to rows in the table "User".&lt;/P&gt;&lt;P&gt;Now, I would like to display in a chart the list of employees of a user, but I can't come up with a way to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone provide any help ?&lt;/P&gt;&lt;P&gt;Thank you very much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 09:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279572#M1196886</guid>
      <dc:creator />
      <dc:date>2011-06-10T09:37:42Z</dc:date>
    </item>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279573#M1196887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Julian.&lt;/P&gt;&lt;P&gt;if you no need a link by both fields (IdUser and IdUserChild) you can rename one field (I think it should be IdUserChild) in User table. after this you will get a link by one field - IdUser&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 10:04:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279573#M1196887</guid>
      <dc:creator>sparur</dc:creator>
      <dc:date>2011-06-10T10:04:23Z</dc:date>
    </item>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279574#M1196888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Julian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you should make a new field wich would act as a composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It´s very easy, just have to concatenate both fields and name it "User_Hierarchy_key" for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IdUser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IdUserChild,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; IdUser &amp;amp; '^' &amp;amp; IdUserChild as User_Hierarchy_key,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create this field in both tables. Then, remove from one of the two tables the fields involving the composite key. For example, remove IdUser and IdUserChild from the User_Hierarchy table and keep them in the User table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have many records in some of the two tables involved, use de AUTONUMBER() function to build a more compact key (translates the concatenated string to a number, which is more memmory and calculations efficient).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AUTONUMBER&lt;/STRONG&gt;( IdUser &amp;amp; '^' &amp;amp; IdUserChild ) as User_Hierarchy_key,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 11:16:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279574#M1196888</guid>
      <dc:creator />
      <dc:date>2011-06-10T11:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279575#M1196889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answers. I still have a problem I don't manage to get ride of: I declare my table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[User]: &lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id as IdUser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id as IdUserChild,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser &amp;amp; '^' &amp;amp; IdUserChild as User_Hierarchy_key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Level&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE Id = $(userid)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM "*****".dbo."User"; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it won't download my database this way, I get the following message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####################&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;IdUser&amp;gt;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM "******".dbo."User"&lt;/P&gt;&lt;P&gt;#####################&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I remove the line "IdUser &amp;amp; '^' &amp;amp; IdUserChild as User_Hierarchy_key,", my script works fine but QV creates a Syn table (is it the normal behaviour ? I've read that it's better to get ride of them)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you once again,&lt;/P&gt;&lt;P&gt;Julian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 12:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279575#M1196889</guid>
      <dc:creator />
      <dc:date>2011-06-10T12:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279576#M1196890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m not sure to understand your problem, but I hope this will be helpful : &lt;/P&gt;&lt;P&gt;For the “field not found”, if you rename a field in a load statement you cannot use it in the same load statement, you have to do something like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id as IdUser,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id as IdUserChild,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser &amp;amp; '^' &amp;amp; IdUserChild as User_Hierarchy_key;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id as IdUser,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id as IdUserChild;&lt;/P&gt;&lt;P&gt;sql select...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For theSync table it’s the normal behavior, Qlikview link fields on their names and can do a link only on one field, so if two tables have more than one common field you will have a sync table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have only two levels of users the simplest way is to create a table for managers and another one for employee : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpUser:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; Id as IdUser,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;sql select...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hierarchy:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdHierarchy, &lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser, &lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUserChild&lt;/P&gt;&lt;P&gt;sql select...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User:&lt;/P&gt;&lt;P&gt;load distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser&lt;/P&gt;&lt;P&gt;resident Hierarchy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join load&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;resident tmpUser;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UserChild:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUserChild&lt;/P&gt;&lt;P&gt;resident Hierarchy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join load&lt;/P&gt;&lt;P&gt;&amp;nbsp; IdUser as IdUserChild;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name&lt;/P&gt;&lt;P&gt;resident tmpUser;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tmpUser;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:23:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279576#M1196890</guid>
      <dc:creator />
      <dc:date>2011-06-10T13:23:32Z</dc:date>
    </item>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279577#M1196891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer. I will try the code you provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I have 3 levels of users, and we will probably create other levels later&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:29:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279577#M1196891</guid>
      <dc:creator />
      <dc:date>2011-06-10T13:29:06Z</dc:date>
    </item>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279578#M1196892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's because IdUser and IdUserChild don't exist in your source table. From what I can gather, &lt;EM&gt;Id &lt;/EM&gt;is the name of the field which you have renamed in this table. Try using Id in your expression instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:44:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279578#M1196892</guid>
      <dc:creator />
      <dc:date>2011-06-10T13:44:25Z</dc:date>
    </item>
    <item>
      <title>Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279579#M1196893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easiest is to denormalize. Just create different dimensions for employee and manager.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 08:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279579#M1196893</guid>
      <dc:creator />
      <dc:date>2011-06-13T08:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279580#M1196894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everybody, I denormalized this part of my db and created a different dimension, it did the trick!&lt;/P&gt;&lt;P&gt;I still have a problem, maybe someone 'll be able to help me. In a chart, I have the following expression (it's a dimension) : =if(IdUser=userid, IdUserChild)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other columns display data about the User (because I used the IdUser field, part of the User table), and not about his child (which is also a User, but I would like QV to use the IdUserChild (FK attached to the User table) field as the identifier to be used, and not IdUser).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 12:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279580#M1196894</guid>
      <dc:creator />
      <dc:date>2011-06-15T12:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279581#M1196895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better create a new thread for that question, cos now in the list it's marked as coorectly answered. And you might want to elaborate a bit more. Try giving a short example with INLINE data and what you expect to be the result. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 13:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279581#M1196895</guid>
      <dc:creator />
      <dc:date>2011-06-15T13:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Two fields in the same table linked with another table.</title>
      <link>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279582#M1196896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I created a new thread there : &lt;A _jive_internal="true" href="https://community.qlik.com/thread/29919"&gt;http://community.qlik.com/thread/29919&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 13:51:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-fields-in-the-same-table-linked-with-another-table/m-p/279582#M1196896</guid>
      <dc:creator />
      <dc:date>2011-06-15T13:51:20Z</dc:date>
    </item>
  </channel>
</rss>

