<?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: Synthetic keys with quarterly data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1560451#M599183</link>
    <description>You have to rename some fileds in order to eliminate the Synthetic Keys.&lt;BR /&gt;&lt;BR /&gt;Load,&lt;BR /&gt;Employee_ID,&lt;BR /&gt;//Other things&lt;BR /&gt;num(month(Date)) as Maand_,&lt;BR /&gt;year(Date) as Year_&lt;BR /&gt;From&lt;BR /&gt;[File];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 24 Mar 2019 16:12:52 GMT</pubDate>
    <dc:creator>Claudiu_Anghelescu</dc:creator>
    <dc:date>2019-03-24T16:12:52Z</dc:date>
    <item>
      <title>Synthetic keys with quarterly data</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1557969#M599182</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm quite new to QlikView, and have some questions regarding the use of synthetic keys.&lt;/P&gt;&lt;P&gt;Within my data model, I've got two data sources:&lt;/P&gt;&lt;P&gt;1) A monthly data dump containing all kinds of information about the employees of the company. This file contains&amp;nbsp;one row per employee, and each employee has a unique employee ID. (Main)&lt;/P&gt;&lt;P&gt;2) A quarterly dump of all the overtime that has been worked. The relevant fields in this file are Employee ID, Date, and Hours. Each row is a seperate instance of overtime worked, and as such there could be multiple rows for&amp;nbsp;one employee. (Overwerk)&lt;/P&gt;&lt;P&gt;In order to combine the data into monthly and quarterly reports, I use the following code snippet&amp;nbsp;in the script&amp;nbsp;of both data sources:&lt;/P&gt;&lt;PRE&gt;Load,
Employee_ID,
//Other things
num(month(Date)) as Maand#,
year(Date) as Year
From
[File];&lt;/PRE&gt;&lt;P&gt;Of course, since these three fields now exist in both tables and the overtime has multiple records for some employees, QlikView creates a synthetic key in order to combine the tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seemed like a perfectly logical solution to me. However, after doing some reading online I discovered that syn keys are generally regarded as a 'bad thing'. But, some other folks say they aren't such a bad thing if required by your data model (with the footnote that it is rarely required and that you should think hard about whether it &lt;EM&gt;is&lt;/EM&gt; actually required).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the background out of the way, I have the following questions:&lt;/P&gt;&lt;P&gt;Would you replace the synthetic key with a different solution in this situation?&lt;/P&gt;&lt;P&gt;I've seen some folks argue that&amp;nbsp;a simple concatenated key table should be used to replace a synthetic key. Why is that solution better than letting the synthetic key remain as-is?&lt;/P&gt;&lt;P&gt;Following the school of thought that syn keys can sometimes be useful: how&amp;nbsp;do you recognise such a situation?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Internal view" style="width: 893px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/8285iA2D3EB384559EA9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV internal table view.png" alt="Internal view" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Internal view&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Source view" style="width: 773px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/8286iC986A59EACE0B671/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV source table view.png" alt="Source view" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Source view&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1557969#M599182</guid>
      <dc:creator>Tom1</dc:creator>
      <dc:date>2024-11-16T04:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic keys with quarterly data</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1560451#M599183</link>
      <description>You have to rename some fileds in order to eliminate the Synthetic Keys.&lt;BR /&gt;&lt;BR /&gt;Load,&lt;BR /&gt;Employee_ID,&lt;BR /&gt;//Other things&lt;BR /&gt;num(month(Date)) as Maand_,&lt;BR /&gt;year(Date) as Year_&lt;BR /&gt;From&lt;BR /&gt;[File];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Mar 2019 16:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1560451#M599183</guid>
      <dc:creator>Claudiu_Anghelescu</dc:creator>
      <dc:date>2019-03-24T16:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic keys with quarterly data</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1561354#M599184</link>
      <description>&lt;P&gt;The thing that I want to be able to do is separate the amount of overtime worked by department (where the department field is only present in the Main table) for each month. For example: assume an employee that transferred from department A to B in July. The overtime overview for June should include their overtime in department A, and in department B for July.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/62957"&gt;@Claudiu_Anghelescu&lt;/a&gt;wouldn't your suggestion result in the above example not work anymore, because the month field for overtime is not the same month field for main?&lt;/P&gt;&lt;P&gt;Could you also expand a bit on &lt;EM&gt;why&lt;/EM&gt; synthetic keys should be eliminated? (Because that's my main question at the moment)&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:42:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1561354#M599184</guid>
      <dc:creator>Tom1</dc:creator>
      <dc:date>2019-03-26T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic keys with quarterly data</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1567871#M599185</link>
      <description>&lt;P&gt;Take a look at the following link, Design Blog post from Henric Cronstrom regarding synthetic keys, hopefully this will give you all the details you need to sort things out.&amp;nbsp; It is generally better to control the links versus using the synthetic keys/tables, as many times those can result in expressions returning results you were not expecting etc.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Synthetic-Keys/ba-p/1472634" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Synthetic-Keys/ba-p/1472634&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 21:13:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-keys-with-quarterly-data/m-p/1567871#M599185</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-04-10T21:13:05Z</dc:date>
    </item>
  </channel>
</rss>

