<?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 Synthetic Key in Incremental Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1602126#M736210</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to perform an incremental load by using a wildcard character to load all the files in a folder. I am using a composite key to act as a primary key. On reloading, I am getting a synthetic key issue.&amp;nbsp; There is a document attached that can give you an idea about what&amp;nbsp; I have done.&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="syn.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15404iA17A0F5F7AE648F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="syn.png" alt="syn.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>gauravs275</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Synthetic Key in Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1602126#M736210</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to perform an incremental load by using a wildcard character to load all the files in a folder. I am using a composite key to act as a primary key. On reloading, I am getting a synthetic key issue.&amp;nbsp; There is a document attached that can give you an idea about what&amp;nbsp; I have done.&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="syn.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15404iA17A0F5F7AE648F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="syn.png" alt="syn.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1602126#M736210</guid>
      <dc:creator>gauravs275</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic Key in Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1602145#M736211</link>
      <description>&lt;P&gt;There is not document attached. Could you please re-attach it?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 06:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1602145#M736211</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-07-15T06:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic Key in Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1610371#M736212</link>
      <description>&lt;P&gt;Gaurav,&lt;/P&gt;
&lt;P&gt;Sorry I am not much direct help here, but I am going to drop a few links that might possibly help and hopefully Vegar may be able to circle back as well.&amp;nbsp; Unfortunately, the platform does not make it very easy for us to be sure we do not miss any follow-up posts, something we are trying to work on.&lt;/P&gt;
&lt;P&gt;Design Blog:&lt;/P&gt;
&lt;P&gt;Synthetic keys:&lt;BR /&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;Incremental Load:&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Overview-of-Qlik-Incremental-Loading/ba-p/1466780" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Overview-of-Qlik-Incremental-Loading/ba-p/1466780&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Help:&lt;/P&gt;
&lt;P&gt;Qualify:&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Qualify.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Qualify.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Unqualify:&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Unqualify.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Unqualify.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The last two above will be a way to try to be sure that&amp;nbsp; synthetic key does not create...&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 18:07:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1610371#M736212</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-08-07T18:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Synthetic Key in Incremental Load</title>
      <link>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1610396#M736213</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/79103"&gt;@gauravs275&lt;/a&gt;&amp;nbsp; It can be tricky with preceeding loads in combination with LOAD ... FROM *, you will often end up with multiple "identical" tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest you try to change your&amp;nbsp; FROM wildchar* script into a loop that reads all files one at the time.&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;for each vFile in FileList('C:\Users\Administrator\Desktop\TRN_BI_KPI_CP2022_PastData\TRN_BI_KPI_CP2022_*.tsv')
	[Transaction]:
	LOAD ... ;
	LOAD ... ;
	LOAD ... ;
	LOAD 
		[Year Id]&amp;amp;'-'&amp;amp;[Reporting Month Id]&amp;amp;'-'&amp;amp;[Block Id]&amp;amp;'-'&amp;amp;[Pillar Id]&amp;amp;'-'&amp;amp;[KPI Id] as %Key,
		[Year Id], 
		Date(Date#([Reporting Month Id],'M'),'MMM') AS [Reporting Month],      
		[Block Id], 
		[Pillar Id], 
		[KPI Id], 
		[Country Code] AS Market,								
		[Latest Flag], 
		Sum([Target Amount])  AS [Target Amount], 
		Sum([Actual Amount]) AS [Actual Amount],
		RowNo() as RowId
	FROM
		[$(vFile)]
		(txt, unicode, embedded labels, delimiter is '\t', msq)
	where 
		match([Latest Flag],1)
	Group By 
		[Year Id], 
		[Reporting Month Id], 
		[Block Id], 
		[Pillar Id], 
		[KPI Id], 
		[Country Code], 
		[Latest Flag];
Next vFile
&lt;/LI-CODE&gt;&lt;P&gt;You will probably get trouble with the LEFT JOIN FROM Wildchar* as well so it is better to first create and fill the table you want to use for the join before executing the JOIN command.&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;/*Creating the table you want to use for join*/
TMP:
LOAD 
 	[Year Id]&amp;amp;'-'&amp;amp;[Reporting Month Id]&amp;amp;'-'&amp;amp;[Block Id]&amp;amp;'-'&amp;amp;[Pillar Id]&amp;amp;'-'&amp;amp;[KPI Id] as %Key,
	[Root Cause], 
	Countermeasure,
	[KPI Result Forecast],
	RowNo() as RowId2 //You will probably not want to join on ths field name
FROM
	[C:\Users\Administrator\Desktop\TRN_BI_KPI_CP2022_PastData\TRN_BI_KPI_CP2022_*.tsv]

/*When all data is collected then do the join*/
LEFT Join (Transactions) 
LOAD * Resident TMP;

/*Drop the TMP as you don't need it in your data model*/
Drop Table TMP;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck with solving you problem.&lt;/P&gt;&lt;P&gt;If these suggestions nor&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14114"&gt;@Brett_Bleess&lt;/a&gt;&amp;nbsp; links doesn't help you, then you will probably need to be more specific and share more details in order to get the community to help you.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 19:40:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Synthetic-Key-in-Incremental-Load/m-p/1610396#M736213</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-08-07T19:40:46Z</dc:date>
    </item>
  </channel>
</rss>

