<?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 QV and QS differences / Synthetic Keys in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2505931#M14583</link>
    <description>&lt;P&gt;I'm trying to port a QV script to QS, but I am having it run out of memory in QS.&lt;/P&gt;
&lt;P&gt;It errors on a loop.&lt;/P&gt;
&lt;P&gt;I chucked in an exit script; to compare the two, and QS is creating a Synthetic join whereas QV doesn't - but I cannot understand why QV isn't??&lt;/P&gt;
&lt;P&gt;Can anyone shed some light it's joined on two fields:&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="Oggy172_1-1739536130549.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177566i61ABFC5BD693F25F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1739536130549.png" alt="Oggy172_1-1739536130549.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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="Oggy172_0-1739536095587.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177565i0A5AE1220FCF87F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_0-1739536095587.png" alt="Oggy172_0-1739536095587.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	/* **************************************************************** */
	//	LOAD Level 0 of the BOM											*/
	/* **************************************************************** */	
	
	_bom:
	LOAD
		RowNo()																		AS	id0,
		[Production BOM No_], 
		[Version Code]																AS	v0, 		
		If([Version Code]='', 'ORIGINAL VERSION', [Production BOM No_] 
			&amp;amp; '-' &amp;amp; [Version Code])													AS	vLink0,		

		ApplyMap('CostingBOMMap', No_, No_)											AS	No_0, 
		ApplyMap('CostingBOMMap', No_, No_)											AS	No_0_No_1_KEY, 
		
//		No_																			AS	No_0, 
//		No_																			AS	No_0_No_1_KEY, 
		
		Quantity																	AS	q0,
		[Unit of Measure Code]														AS	um0,
		[Scrap %]																	AS	s0
	FROM
	d:\qlik\datasources\qvd\BOM_Line.qvd
	(qvd)
	WHERE EXISTS ([Costing BOM No_], [Production BOM No_]);  //can use field [Costing BOM No_] since it is not qualified and has already been loaded (load top level only)
			
	//	Load Version Information for BOM

	_version:
	LOAD 
		[Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code]									AS	vLink0, //links back to _bom
//	    TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0
	    TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0
	FROM
		d:\qlik\datasources\qvd\BOM_Ver.qvd
	(qvd)
	WHERE EXISTS (vLink0, [Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code]);

		//	Current Version

		INNER JOIN (_version)
		LOAD 
//			TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0,
			TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0,
			[Production BOM No_] 														AS	_vs_bom0,
			MaxString([Version Code])													AS	v0
		FROM
			d:\qlik\datasources\qvd\BOM_Ver.qvd
		(qvd)
		WHERE EXISTS (vLink0, [Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code])
//		GROUP BY TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss'), [Production BOM No_];
		GROUP BY TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss'), [Production BOM No_];
		
		//
		
		CONCATENATE (_version)
		LOAD
			'ORIGINAL VERSION' 															AS	_vs_bom0,
			'ORIGINAL VERSION' 															AS vLink0,
			''																			AS	v0,
			Null()																		AS	_vs0
		AUTOGENERATE (1);
		
		//
		
		INNER JOIN (_bom) LOAD * RESIDENT _version;
		
		DROP TABLE _version;
	
	//	Calculate the Start Time
	
	LEFT JOIN (_bom)                          //adds fields onto the existing table _bom
	LOAD
		id0,
		[Production BOM No_],
		No_0,
//		TimeStamp(If(IsNull(_vs0), MakeDate(1990, 7, 5), TimeStamp#(_vs0, 'YYYY-MM-DD hh:mm:ss')))						AS	vs0 //resident table already in memory
		TimeStamp(If(IsNull(_vs0), MakeDate(1990, 7, 5), TimeStamp(_vs0, 'YYYY-MM-DD hh:mm:ss')))						AS	vs0 //resident table already in memory
	RESIDENT 
		_bom;
		
		DROP FIELD _vs0;     //delete old date filed NB function is "DROP FIELD"
	
	//	Calculate the End Time
	
	NOCONCATENATE _endTime:
	LOAD DISTINCT
		[Production BOM No_],
		vs0
	RESIDENT 
		_bom;&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 14 Feb 2025 12:30:45 GMT</pubDate>
    <dc:creator>Oggy172</dc:creator>
    <dc:date>2025-02-14T12:30:45Z</dc:date>
    <item>
      <title>QV and QS differences / Synthetic Keys</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2505931#M14583</link>
      <description>&lt;P&gt;I'm trying to port a QV script to QS, but I am having it run out of memory in QS.&lt;/P&gt;
&lt;P&gt;It errors on a loop.&lt;/P&gt;
&lt;P&gt;I chucked in an exit script; to compare the two, and QS is creating a Synthetic join whereas QV doesn't - but I cannot understand why QV isn't??&lt;/P&gt;
&lt;P&gt;Can anyone shed some light it's joined on two fields:&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="Oggy172_1-1739536130549.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177566i61ABFC5BD693F25F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_1-1739536130549.png" alt="Oggy172_1-1739536130549.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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="Oggy172_0-1739536095587.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177565i0A5AE1220FCF87F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oggy172_0-1739536095587.png" alt="Oggy172_0-1739536095587.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	/* **************************************************************** */
	//	LOAD Level 0 of the BOM											*/
	/* **************************************************************** */	
	
	_bom:
	LOAD
		RowNo()																		AS	id0,
		[Production BOM No_], 
		[Version Code]																AS	v0, 		
		If([Version Code]='', 'ORIGINAL VERSION', [Production BOM No_] 
			&amp;amp; '-' &amp;amp; [Version Code])													AS	vLink0,		

		ApplyMap('CostingBOMMap', No_, No_)											AS	No_0, 
		ApplyMap('CostingBOMMap', No_, No_)											AS	No_0_No_1_KEY, 
		
//		No_																			AS	No_0, 
//		No_																			AS	No_0_No_1_KEY, 
		
		Quantity																	AS	q0,
		[Unit of Measure Code]														AS	um0,
		[Scrap %]																	AS	s0
	FROM
	d:\qlik\datasources\qvd\BOM_Line.qvd
	(qvd)
	WHERE EXISTS ([Costing BOM No_], [Production BOM No_]);  //can use field [Costing BOM No_] since it is not qualified and has already been loaded (load top level only)
			
	//	Load Version Information for BOM

	_version:
	LOAD 
		[Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code]									AS	vLink0, //links back to _bom
//	    TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0
	    TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0
	FROM
		d:\qlik\datasources\qvd\BOM_Ver.qvd
	(qvd)
	WHERE EXISTS (vLink0, [Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code]);

		//	Current Version

		INNER JOIN (_version)
		LOAD 
//			TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0,
			TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss')							AS	_vs0,
			[Production BOM No_] 														AS	_vs_bom0,
			MaxString([Version Code])													AS	v0
		FROM
			d:\qlik\datasources\qvd\BOM_Ver.qvd
		(qvd)
		WHERE EXISTS (vLink0, [Production BOM No_] &amp;amp; '-' &amp;amp; [Version Code])
//		GROUP BY TimeStamp#([Starting Date], 'DD/MM/YYYY hh:mm:ss'), [Production BOM No_];
		GROUP BY TimeStamp([Starting Date], 'DD/MM/YYYY hh:mm:ss'), [Production BOM No_];
		
		//
		
		CONCATENATE (_version)
		LOAD
			'ORIGINAL VERSION' 															AS	_vs_bom0,
			'ORIGINAL VERSION' 															AS vLink0,
			''																			AS	v0,
			Null()																		AS	_vs0
		AUTOGENERATE (1);
		
		//
		
		INNER JOIN (_bom) LOAD * RESIDENT _version;
		
		DROP TABLE _version;
	
	//	Calculate the Start Time
	
	LEFT JOIN (_bom)                          //adds fields onto the existing table _bom
	LOAD
		id0,
		[Production BOM No_],
		No_0,
//		TimeStamp(If(IsNull(_vs0), MakeDate(1990, 7, 5), TimeStamp#(_vs0, 'YYYY-MM-DD hh:mm:ss')))						AS	vs0 //resident table already in memory
		TimeStamp(If(IsNull(_vs0), MakeDate(1990, 7, 5), TimeStamp(_vs0, 'YYYY-MM-DD hh:mm:ss')))						AS	vs0 //resident table already in memory
	RESIDENT 
		_bom;
		
		DROP FIELD _vs0;     //delete old date filed NB function is "DROP FIELD"
	
	//	Calculate the End Time
	
	NOCONCATENATE _endTime:
	LOAD DISTINCT
		[Production BOM No_],
		vs0
	RESIDENT 
		_bom;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Feb 2025 12:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2505931#M14583</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-02-14T12:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: QV and QS differences / Synthetic Keys</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2505934#M14584</link>
      <description>&lt;P&gt;It's both the same - with a synthetic key which will also be stated in the log-file. The difference here is that the data-model viewer in QV showed the data-sources and not the internal tables. There is an switch-option on the left side of the zoom-factor (I don't know if there are similar display options in Sense).&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 12:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2505934#M14584</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-02-14T12:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: QV and QS differences / Synthetic Keys</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2506109#M14590</link>
      <description>&lt;P&gt;You are correct, thanks for confirming that I am not going insane.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 08:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/QV-and-QS-differences-Synthetic-Keys/m-p/2506109#M14590</guid>
      <dc:creator>Oggy172</dc:creator>
      <dc:date>2025-02-17T08:47:16Z</dc:date>
    </item>
  </channel>
</rss>

