<?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: How to solve Synthetic key in this case? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461353#M98883</link>
    <description>&lt;P&gt;That is the beauty of Qlik. In Global Search Bar, if you type for John Smith, it will show up on both Agents and Responders fields. So, separated tables/fields are classifying in advance the role of the agent in different contexts. This will be specially interesting if you use Left Keep to reduce the agent source table by the context (agent or responders) so you can have a complete list of Agents or Responders.&lt;/P&gt;
&lt;P&gt;It is possible to keep Agents and Responders in one single table but his is way trickier and I'm not sure if this will improve the usability of the app and the craft of the Expressions. Maybe joining the Conversations to the Tickets folder + multiplying records on Agents and Contacts tables + some field manipulation will do the magic.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2024 17:22:09 GMT</pubDate>
    <dc:creator>marksouzacosta</dc:creator>
    <dc:date>2024-06-11T17:22:09Z</dc:date>
    <item>
      <title>How to solve Synthetic key in this case?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2460942#M98838</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;We load data from the service we use via the REST connector. Below is a simplified script that represents the data structure (entities and keys) we got:&lt;/P&gt;
&lt;PRE&gt;[tickets]:&lt;BR /&gt;Load &lt;BR /&gt;   tickets.id,&lt;BR /&gt;   tickets.requester_id as contacts.id,&lt;BR /&gt;   tickets.responder_id as agents.id&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   tickets.id, tickets.requester_id, tickets.responder_id&lt;BR /&gt;   1, 2, 3&lt;BR /&gt;   2, 3, 1&lt;BR /&gt;   3, 3, 2&lt;BR /&gt;   4, 1, 2 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[conversations]:&lt;BR /&gt;Load &lt;BR /&gt;   conversations.id,&lt;BR /&gt;   conversations.ticket_id as tickets.id,&lt;BR /&gt;   conversations.contact_id as contacts.id, // If contact_id is set, then agent_id will be empty (conversation can belong to either contact or agent)&lt;BR /&gt;   conversations.agent_id as agents.id // If agent_id is set, then agent_id will be empty (conversation can belong to either contact or agent)&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   conversations.id, conversations.ticket_id, conversations.contact_id, conversations.agent_id&lt;BR /&gt;   1, 1, 2, 2&lt;BR /&gt;   2, 1, 1, 2&lt;BR /&gt;   3, 2, 3, 1&lt;BR /&gt;   4, 4, 2, 3 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[contacts]:&lt;BR /&gt;Load &lt;BR /&gt;   contacts.id&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   contacts.id&lt;BR /&gt;   1,&lt;BR /&gt;   2,&lt;BR /&gt;   3 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[agents]:&lt;BR /&gt;Load &lt;BR /&gt;   agents.id&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   agents.id&lt;BR /&gt;   1,&lt;BR /&gt;   2,&lt;BR /&gt;   3 &lt;BR /&gt;];&lt;/PRE&gt;
&lt;P&gt;This results in a Synthetic key:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;$Syn 1 = tickets.id+contacts.id+agents.id&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Synthetic key.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/167670i214A38F68F3DFC47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Synthetic key.png" alt="Synthetic key.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;We have seen the &lt;A href="https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/LoadData/synthetic-keys.htm" target="_self"&gt;Qlik documentation on synthetic keys&lt;/A&gt;, where it states that renaming one or more fields in the tables is a solution, but we are not sure that this is possible in this case because there are the following requirements:&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;&lt;STRONG&gt;&lt;EM&gt;conversations &lt;/EM&gt;entity:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;Note: &lt;EM&gt;conversation&lt;/EM&gt; can belong to either &lt;EM&gt;contact&lt;/EM&gt; or &lt;EM&gt;agent&lt;/EM&gt;. If &lt;EM&gt;contact_id&lt;/EM&gt; is set, then &lt;EM&gt;agent_id&lt;/EM&gt; will be empty and vice versa. So, the owner can be either a &lt;EM&gt;contact&lt;/EM&gt; or an &lt;EM&gt;agent&lt;/EM&gt;, but not both at the same time. Also, each conversation will always belong to one &lt;EM&gt;ticket&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For each &lt;EM&gt;conversation&lt;/EM&gt;, show the &lt;EM&gt;ticket&lt;/EM&gt; to which it belongs as well as the owner (&lt;EM&gt;contact&lt;/EM&gt; or &lt;EM&gt;agent&lt;/EM&gt;);&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;&lt;STRONG&gt;&lt;EM&gt;tickets&lt;/EM&gt; entity:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For specific &lt;EM&gt;ticket(s)&lt;/EM&gt;, display &lt;EM&gt;conversations&lt;/EM&gt; (a ticket can have 0 or more &lt;EM&gt;conversations&lt;/EM&gt;);&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For each &lt;EM&gt;ticket&lt;/EM&gt;, display the contact and the agent who owns it (each &lt;EM&gt;ticket&lt;/EM&gt; belongs to one &lt;EM&gt;contact&lt;/EM&gt; and one &lt;EM&gt;agent&lt;/EM&gt;)&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;&lt;STRONG&gt;&lt;EM&gt;contacts&lt;/EM&gt; entity&lt;/STRONG&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For specific &lt;EM&gt;contact(s)&lt;/EM&gt;, display tickets (a contact can have 0 or more tickets);&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For specific &lt;EM&gt;contact(s)&lt;/EM&gt;, display conversations (a contact can have 0 or more conversations);&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;&lt;STRONG&gt;&lt;EM&gt;agents&lt;/EM&gt; entity:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For specific agent(s), display tickets (an agent can have 0 or more tickets);&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="times new roman,times" color="#333333"&gt;For specific agent(s), display conversations (an agent can have 0 or more conversations);&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;It seems that if we rename/remove one or more fields from any entity, then we will lose the relationship/ability to implement at least one of the above requirements? &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Do you have any suggestions on how we can resolve this?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 19:25:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2460942#M98838</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-06-10T19:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve Synthetic key in this case?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2460968#M98839</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252108"&gt;@RoyBatty&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What about this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[tickets]:
Load 
   tickets.id,
   tickets.requester_id as requester_id,
   tickets.responder_id as responder_id
Inline [
   tickets.id, tickets.requester_id, tickets.responder_id
   1, 2, 3
   2, 3, 1
   3, 3, 2
   4, 1, 2 
];


[Requesters]:
Load 
   contacts.id as requester_id
   // Other fields are omitted for simplicity
Inline [
   contacts.id
   1,
   2,
   3 
];

[Responders]:
Load 
   agents.id as responder_id
   // Other fields are omitted for simplicity
Inline [
   agents.id
   1,
   2,
   3 
];




[conversations]:
Load 
   conversations.id,
   conversations.ticket_id as tickets.id,
   conversations.contact_id as contacts.id, // If contact_id is set, then agent_id will be empty (conversation can belong to either contact or agent)
   conversations.agent_id as agents.id // If agent_id is set, then agent_id will be empty (conversation can belong to either contact or agent)
   // Other fields are omitted for simplicity
Inline [
   conversations.id, conversations.ticket_id, conversations.contact_id, conversations.agent_id
   1, 1, 2, 2
   2, 1, 1, 2
   3, 2, 3, 1
   4, 4, 2, 3 
];

[contacts]:
Load 
   contacts.id
   // Other fields are omitted for simplicity
Inline [
   contacts.id
   1,
   2,
   3 
];

[agents]:
Load 
   agents.id
   // Other fields are omitted for simplicity
Inline [
   agents.id
   1,
   2,
   3 
];
&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="marksouzacosta_0-1718058685642.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/167678i7E21AD4041738A48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marksouzacosta_0-1718058685642.png" alt="marksouzacosta_0-1718058685642.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 22:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2460968#M98839</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-06-10T22:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve Synthetic key in this case?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461342#M98881</link>
      <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;So basically, create a duplicate tables:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;[requesters] table is the same as [contacts] table (just different table and column names)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;[responders] table is the same as [agents] table (just different table and column names)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;We are not sure if this is the best solution because:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;We duplicated the tables, and it can be confusing: both represent the "agent", both are exactly identical,&amp;nbsp;but they are unrelated and if the user filters by a value from one of those two tables - then it will not filter by the same value from the other table.&amp;nbsp;So, filtering by "&lt;EM&gt;John Smith"&lt;/EM&gt; from the &lt;STRONG&gt;[agents]&lt;/STRONG&gt; table is not the same (will not give the same results) as if we were to filter by the same "&lt;EM&gt;John Smith"&lt;/EM&gt; from the &lt;STRONG&gt;[responders]&lt;/STRONG&gt; table. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Actually, we are not sure, maybe no other/better way is possible to handle this. Anyway, we'll give it some thought, test it, and see how it goes... and come back here to conclude &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 16:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461342#M98881</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-06-11T16:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve Synthetic key in this case?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461353#M98883</link>
      <description>&lt;P&gt;That is the beauty of Qlik. In Global Search Bar, if you type for John Smith, it will show up on both Agents and Responders fields. So, separated tables/fields are classifying in advance the role of the agent in different contexts. This will be specially interesting if you use Left Keep to reduce the agent source table by the context (agent or responders) so you can have a complete list of Agents or Responders.&lt;/P&gt;
&lt;P&gt;It is possible to keep Agents and Responders in one single table but his is way trickier and I'm not sure if this will improve the usability of the app and the craft of the Expressions. Maybe joining the Conversations to the Tickets folder + multiplying records on Agents and Contacts tables + some field manipulation will do the magic.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 17:22:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461353#M98883</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-06-11T17:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve Synthetic key in this case?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461919#M98915</link>
      <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;I would add that, in addition to the solution that&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22035"&gt;@marksouzacosta&lt;/a&gt;&amp;nbsp; offered, another option is to leave the synthetic key:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;If the data model is correct&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;and if there's only one synthetic key&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;and &lt;EM&gt;$Syn 1 Table&lt;/EM&gt; is relatively small (in our case less than 34000 rows)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;then there should be no problem handling it, nor should there be any problem with excessive amount of time and/or memory.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;--------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;UPDATE:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;One more note: In case you decide to keep synthetic key, use separate keys for relations. In our example (given above), the following synthetic key is formed:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;$Syn 1 = tickets.id+contacts.id+agents.id&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;So we will add keys in all those tables: &lt;STRONG&gt;%ticket_id&lt;/STRONG&gt;, &lt;STRONG&gt;%contact_id&lt;/STRONG&gt; and &lt;STRONG&gt;%agent_id&lt;/STRONG&gt;:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;[tickets]:&lt;BR /&gt;Load &lt;BR /&gt;   tickets.id,&lt;BR /&gt;   tickets.id as %ticket_id, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   tickets.requester_id as %contact_id, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   tickets.responder_id as %agent_id // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   tickets.id, tickets.requester_id, tickets.responder_id&lt;BR /&gt;   1, 2, 3&lt;BR /&gt;   2, 3, 1&lt;BR /&gt;   3, 3, 2&lt;BR /&gt;   4, 1, 2 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[conversations]:&lt;BR /&gt;Load &lt;BR /&gt;   conversations.id,&lt;BR /&gt;   conversations.ticket_id as %ticket_id, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   conversations.contact_id as %contact_id, // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   conversations.agent_id as %agent_id // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   conversations.id, conversations.ticket_id, conversations.contact_id, conversations.agent_id&lt;BR /&gt;   1, 1, 2, 2&lt;BR /&gt;   2, 1, 1, 2&lt;BR /&gt;   3, 2, 3, 1&lt;BR /&gt;   4, 4, 2, 3 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[contacts]:&lt;BR /&gt;Load &lt;BR /&gt;   contacts.id,&lt;BR /&gt;   contacts.id as %contact_id // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   contacts.id&lt;BR /&gt;   1,&lt;BR /&gt;   2,&lt;BR /&gt;   3 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[agents]:&lt;BR /&gt;Load &lt;BR /&gt;   agents.id,&lt;BR /&gt;   agents.id as %agent_id // &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;   // Other fields are omitted for simplicity&lt;BR /&gt;Inline [&lt;BR /&gt;   agents.id&lt;BR /&gt;   1,&lt;BR /&gt;   2,&lt;BR /&gt;   3 &lt;BR /&gt;];&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Now the synthetic key will look like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="HwtZe"&gt;$Syn 1 = &lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;%ticket_id&lt;/SPAN&gt;&lt;/SPAN&gt;+&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;%contact_id&lt;/SPAN&gt;&lt;/SPAN&gt;+&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;%agent_id&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So, keys&amp;nbsp;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;&lt;STRONG&gt;%ticket_id&lt;/STRONG&gt;, &lt;STRONG&gt;%contact_id&lt;/STRONG&gt; and &lt;STRONG&gt;%agent_id&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz JxVs2d ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;will be used &lt;EM&gt;only&lt;/EM&gt; for relationships and nothing more. They should not be used as dimensions or for measurements on visualizations. For example, you would use &lt;STRONG&gt;tickets.id&lt;/STRONG&gt; as the dimension (&lt;STRONG&gt;not&lt;/STRONG&gt; %ticket_id). Or, if you want to count tickets: Count([&lt;STRONG&gt;tickets.id&lt;/STRONG&gt;]) (&lt;STRONG&gt;not&lt;/STRONG&gt; Count([%ticket_id])).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 15:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-solve-Synthetic-key-in-this-case/m-p/2461919#M98915</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-06-13T15:53:55Z</dc:date>
    </item>
  </channel>
</rss>

