<?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: Transforming SQL syntax in qliksense script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791357#M61874</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49688"&gt;@berkarmagan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some changes and transformed the sql in qliksense script like below:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD *;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;"tag_UID",&lt;/P&gt;&lt;P&gt;"tag_Material",&lt;/P&gt;&lt;P&gt;"tag_Mat_Description",&lt;/P&gt;&lt;P&gt;"tag_SkidID",&lt;/P&gt;&lt;P&gt;"tag_LogicalSkidID",&lt;/P&gt;&lt;P&gt;"tag_SkidPosition",&lt;/P&gt;&lt;P&gt;"tag_Version",&lt;/P&gt;&lt;P&gt;"tag_Color",&lt;/P&gt;&lt;P&gt;"tag_Changer",&lt;/P&gt;&lt;P&gt;"tag_ChangeDate",&lt;/P&gt;&lt;P&gt;"tag_TrolleyID",&lt;/P&gt;&lt;P&gt;"tag_Undetected",&lt;/P&gt;&lt;P&gt;"tag_Mold",&lt;/P&gt;&lt;P&gt;"tag_Cavity",&lt;/P&gt;&lt;P&gt;"tag_ProdDate",&lt;/P&gt;&lt;P&gt;"tag_UndetecCount",&lt;/P&gt;&lt;P&gt;"tag_InternalID"&lt;/P&gt;&lt;P&gt;FROM ( SELECT tag_UID a, MAX(tag_ChangeDate) AS Max_Datetime&lt;/P&gt;&lt;P&gt;FROM PTag.dbo."Tag_Data"&lt;/P&gt;&lt;P&gt;where tag_changer is not null and tag_changer not in ('null')&lt;/P&gt;&lt;P&gt;GROUP BY tag_UID) AS x INNER JOIN&lt;/P&gt;&lt;P&gt;PTag.dbo."Tag_Data" ON&lt;/P&gt;&lt;P&gt;x.a = tag_UID and x.Max_Datetime=tag_ChangeDate and tag_ProdDate &amp;gt;= '01/01/2021' ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=================================================================================&lt;/P&gt;&lt;P&gt;Now, how should i achieve the below qliksense tranforamtion in the above script:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;tag_UID,&lt;BR /&gt;tag_Material,&lt;BR /&gt;tag_Mat_Description,&lt;BR /&gt;tag_SkidID,&lt;BR /&gt;tag_LogicalSkidID,&lt;BR /&gt;tag_SkidPosition,&lt;BR /&gt;tag_Version,&lt;BR /&gt;tag_Color,&lt;BR /&gt;IF( "tag_Color" = 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_mold,&lt;BR /&gt;IF( "tag_Color" &amp;lt;&amp;gt; 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_paint,&lt;BR /&gt;"tag_UID" &amp;amp; "tag_ChangeDate" as Key,&lt;BR /&gt;tag_Changer,&lt;BR /&gt;tag_ChangeDate,&lt;BR /&gt;tag_TrolleyID,&lt;BR /&gt;tag_Undetected,&lt;BR /&gt;tag_Mold,&lt;BR /&gt;tag_Cavity,&lt;BR /&gt;tag_ProdDate,&lt;BR /&gt;tag_UndetecCount,&lt;BR /&gt;tag_InternalID&lt;BR /&gt;FROM [.......qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;A:&lt;BR /&gt;Mapping&lt;BR /&gt;Load Key as Key1, tag_TrolleyID_mold Resident Data;&lt;/P&gt;&lt;P&gt;B:&lt;BR /&gt;Mapping&lt;BR /&gt;Load Key as Key2, tag_TrolleyID_paint Resident Data;&lt;/P&gt;&lt;P&gt;D :&amp;nbsp;&lt;BR /&gt;Load Distinct tag_UID Resident Data;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key1,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_mold&lt;BR /&gt;Resident Data where tag_Color = 'NULL' group by tag_UID; //tag_Color;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color ,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key2,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_paint&lt;BR /&gt;Resident Data where tag_Color &amp;lt;&amp;gt; 'NULL' group by tag_UID ;//tag_Color;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *,&lt;BR /&gt;ApplyMap('A', key1, '-') as tag_TrolleyID_mold,&lt;BR /&gt;ApplyMap('B', key2, '-') as tag_TrolleyID_paint&lt;BR /&gt;Resident D;&lt;BR /&gt;&lt;BR /&gt;drop tables Data, D;&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;I need to do the qliksense script logic in the sql query in order to combine the result in one extractor. Insted of first extracting the data into qvd and then transformin it.&lt;/P&gt;&lt;P&gt;I tried the syntax that you gave earlier but i am unable to achieve it.&lt;/P&gt;&lt;P&gt;Can you please help as i am stuck on it from a long time now ? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Please help&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 11:36:18 GMT</pubDate>
    <dc:creator>Aspiring_Developer</dc:creator>
    <dc:date>2021-03-15T11:36:18Z</dc:date>
    <item>
      <title>Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789566#M61691</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below sql query used for data extraction:-&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD "tag_UID",&lt;BR /&gt;"tag_Material",&lt;BR /&gt;"tag_Mat_Description",&lt;BR /&gt;"tag_SkidID",&lt;BR /&gt;"tag_LogicalSkidID",&lt;BR /&gt;"tag_SkidPosition",&lt;BR /&gt;"tag_Version",&lt;BR /&gt;"tag_Color",&lt;BR /&gt;"tag_Changer",&lt;BR /&gt;"tag_ChangeDate",&lt;BR /&gt;"tag_TrolleyID",&lt;BR /&gt;"tag_Undetected",&lt;BR /&gt;"tag_Mold",&lt;BR /&gt;"tag_Cavity",&lt;BR /&gt;"tag_ProdDate",&lt;BR /&gt;"tag_UndetecCount",&lt;BR /&gt;"tag_InternalID",&lt;BR /&gt;"tag_IMPCCycleNumber",&lt;BR /&gt;"tag_IMPCCompliance",&lt;BR /&gt;"tag_IMPCCreatedAt",&lt;BR /&gt;"tag_QualityStatus";&lt;BR /&gt;SQL SELECT "tag_UID",&lt;BR /&gt;"tag_Material",&lt;BR /&gt;"tag_Mat_Description",&lt;BR /&gt;"tag_SkidID",&lt;BR /&gt;"tag_LogicalSkidID",&lt;BR /&gt;"tag_SkidPosition",&lt;BR /&gt;"tag_Version",&lt;BR /&gt;"tag_Color",&lt;BR /&gt;"tag_Changer",&lt;BR /&gt;"tag_ChangeDate",&lt;BR /&gt;"tag_TrolleyID",&lt;BR /&gt;"tag_Undetected",&lt;BR /&gt;"tag_Mold",&lt;BR /&gt;"tag_Cavity",&lt;BR /&gt;"tag_ProdDate",&lt;BR /&gt;"tag_UndetecCount",&lt;BR /&gt;"tag_InternalID",&lt;BR /&gt;"tag_IMPCCycleNumber",&lt;BR /&gt;"tag_IMPCCompliance",&lt;BR /&gt;"tag_IMPCCreatedAt",&lt;BR /&gt;"tag_QualityStatus"&lt;BR /&gt;FROM PTag.dbo."Tag_Data" where&lt;BR /&gt;tag_changer is not null and tag_changer not in ('null') and tag_Changer not like 'Undetected%'&lt;BR /&gt;and tag_ProdDate &amp;gt;='01/01/2021';&lt;/P&gt;&lt;P&gt;=====================================&lt;/P&gt;&lt;P&gt;Post extraction, i did some below transformations to optimize the data as per my requirement:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;tag_UID,&lt;BR /&gt;tag_Color,&lt;BR /&gt;tag_ChangeDate,&lt;BR /&gt;tag_UID &amp;amp; tag_ChangeDate as key,&lt;BR /&gt;tag_TrolleyID,&lt;BR /&gt;// "tag_Material",&lt;BR /&gt;// "tag_Mat_Description",&lt;BR /&gt;// "tag_SkidID",&lt;BR /&gt;// "tag_LogicalSkidID",&lt;BR /&gt;// "tag_SkidPosition",&lt;BR /&gt;if(tag_Color = 'NULL', tag_TrolleyID ) as tag_TrolleyID_mold,&lt;BR /&gt;if(tag_Color &amp;lt;&amp;gt; 'NULL', tag_TrolleyID ) as tag_TrolleyID_paint&lt;/P&gt;&lt;P&gt;FROM [......]&lt;BR /&gt;(qvd)&lt;/P&gt;&lt;P&gt;where tag_TrolleyID &amp;lt;&amp;gt;'NULL' and tag_TrolleyID &amp;lt;&amp;gt;'';&lt;BR /&gt;//tag_ProdDate &amp;gt;='2/18/2021'and&lt;BR /&gt;//Exit Script;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A:&lt;BR /&gt;Mapping&lt;BR /&gt;Load key as Key1, tag_TrolleyID_mold Resident Data;&lt;/P&gt;&lt;P&gt;B:&lt;BR /&gt;Mapping&lt;BR /&gt;Load key as Key2, tag_TrolleyID_paint Resident Data;&lt;/P&gt;&lt;P&gt;D :&amp;nbsp;&lt;BR /&gt;load distinct tag_UID resident Data;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key1,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_mold&lt;BR /&gt;Resident Data where tag_Color = 'NULL' group by tag_UID; //tag_Color;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color ,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key2,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_paint&lt;BR /&gt;Resident Data where tag_Color &amp;lt;&amp;gt; 'NULL' group by tag_UID ;//tag_Color;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *,&lt;BR /&gt;ApplyMap('A', key1, '-') as tag_TrolleyID_mold,&lt;BR /&gt;ApplyMap('B', key2, '-') as tag_TrolleyID_paint&lt;BR /&gt;Resident D;&lt;BR /&gt;&lt;BR /&gt;drop tables Data, D;&lt;/P&gt;&lt;P&gt;Store Final into ....&lt;/P&gt;&lt;P&gt;=======================================================================&lt;/P&gt;&lt;P&gt;Now i want to do the above transformatiion in the SQL extractor but i am not very much aware of the sql syntaxes.&lt;/P&gt;&lt;P&gt;Can anyone please guide me on how can i do the qliksesne script transformation directly in the SQL query extractor.&lt;/P&gt;&lt;P&gt;The purpose of doing this is to reduce the load time and get desired number of rows.&lt;/P&gt;&lt;P&gt;Can any please help me .... ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 12:35:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789566#M61691</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-09T12:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789904#M61716</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all, getting data directly from SQL will not solve ur problem I think because it is another process that you should wait for it. If your sql server is fast enough maybe it would decrease your load time but i think you should think about getting data from the qvds without optimized load it can be a problem. So i think try to get data from qvd with optimized process which you shouldn't use where clause s in your script. It would increase your data load speed..&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way if you need to do it on sql server anyway you should just join tables in sql which you're doing in qlik script like ;&lt;/P&gt;&lt;P&gt;with data as (Select * &lt;SPAN&gt;FROM PTag.dbo."Tag_Data"&amp;nbsp; where&lt;BR /&gt;tag_changer is not null and tag_changer not in ('null') and tag_Changer not like 'Undetected%'&lt;BR /&gt;and tag_ProdDate &amp;gt;='01/01/2021')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;select * from data x&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;left join (tag_UID,&lt;BR /&gt;convert(nvarhcar(10),tag_UID) +''+ convert(nvarhcar(10),max(tag_ChangeDate)) as key1,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_mold&lt;BR /&gt;from Data where tag_Color = 'NULL' group by tag_UID)y on y.tag_UID=x.tag_UID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 06:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789904#M61716</guid>
      <dc:creator>berkarmagan</dc:creator>
      <dc:date>2021-03-10T06:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789905#M61717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49688"&gt;@berkarmagan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;My requirement is to tranform the select query syntax in qliksense script itslef .&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD "tag_UID",&lt;BR /&gt;"tag_Material",&lt;BR /&gt;"tag_Mat_Description",&lt;BR /&gt;"tag_SkidID",&lt;BR /&gt;"tag_LogicalSkidID",&lt;BR /&gt;"tag_SkidPosition",&lt;BR /&gt;"tag_Version",&lt;BR /&gt;"tag_Color",&lt;BR /&gt;"tag_Changer",&lt;BR /&gt;"tag_ChangeDate",&lt;BR /&gt;"tag_TrolleyID",&lt;BR /&gt;"tag_Undetected",&lt;BR /&gt;"tag_Mold",&lt;BR /&gt;"tag_Cavity",&lt;BR /&gt;"tag_ProdDate",&lt;BR /&gt;"tag_UndetecCount",&lt;BR /&gt;"tag_InternalID",&lt;BR /&gt;"tag_IMPCCycleNumber",&lt;BR /&gt;"tag_IMPCCompliance",&lt;BR /&gt;"tag_IMPCCreatedAt",&lt;BR /&gt;"tag_QualityStatus";&lt;BR /&gt;SQL SELECT "tag_UID",&lt;BR /&gt;"tag_Material",&lt;BR /&gt;"tag_Mat_Description",&lt;BR /&gt;"tag_SkidID",&lt;BR /&gt;"tag_LogicalSkidID",&lt;BR /&gt;"tag_SkidPosition",&lt;BR /&gt;"tag_Version",&lt;BR /&gt;"tag_Color",&lt;BR /&gt;"tag_Changer",&lt;BR /&gt;"tag_ChangeDate",&lt;BR /&gt;"tag_TrolleyID",&lt;BR /&gt;"tag_Undetected",&lt;BR /&gt;"tag_Mold",&lt;BR /&gt;"tag_Cavity",&lt;BR /&gt;"tag_ProdDate",&lt;BR /&gt;"tag_UndetecCount",&lt;BR /&gt;"tag_InternalID",&lt;BR /&gt;"tag_IMPCCycleNumber",&lt;BR /&gt;"tag_IMPCCompliance",&lt;BR /&gt;"tag_IMPCCreatedAt",&lt;BR /&gt;"tag_QualityStatus"&lt;BR /&gt;FROM PTag.dbo."Tag_Data" where&lt;BR /&gt;tag_changer is not null and tag_changer not in ('null') and tag_Changer not like 'Undetected%'&lt;BR /&gt;and tag_ProdDate &amp;gt;='01/01/2021';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to do the transformation here in the qliksense select query (no in the sql server)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 07:03:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789905#M61717</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-10T07:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789910#M61718</link>
      <description>&lt;P&gt;Ok but&amp;nbsp; if you need the change sql statemnts in qlik scripts - it means it will also run on SQL server, if you write your code even in sql management studio or Qlik script.&lt;/P&gt;&lt;P&gt;I hope i dont understand ur problem wrong but anyway if you want do all the things in Qliksense script editor with sql statements, you can use a query like that my previous post. But i don't reccomend that if i m clear about the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 07:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1789910#M61718</guid>
      <dc:creator>berkarmagan</dc:creator>
      <dc:date>2021-03-10T07:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791357#M61874</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49688"&gt;@berkarmagan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some changes and transformed the sql in qliksense script like below:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD *;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;"tag_UID",&lt;/P&gt;&lt;P&gt;"tag_Material",&lt;/P&gt;&lt;P&gt;"tag_Mat_Description",&lt;/P&gt;&lt;P&gt;"tag_SkidID",&lt;/P&gt;&lt;P&gt;"tag_LogicalSkidID",&lt;/P&gt;&lt;P&gt;"tag_SkidPosition",&lt;/P&gt;&lt;P&gt;"tag_Version",&lt;/P&gt;&lt;P&gt;"tag_Color",&lt;/P&gt;&lt;P&gt;"tag_Changer",&lt;/P&gt;&lt;P&gt;"tag_ChangeDate",&lt;/P&gt;&lt;P&gt;"tag_TrolleyID",&lt;/P&gt;&lt;P&gt;"tag_Undetected",&lt;/P&gt;&lt;P&gt;"tag_Mold",&lt;/P&gt;&lt;P&gt;"tag_Cavity",&lt;/P&gt;&lt;P&gt;"tag_ProdDate",&lt;/P&gt;&lt;P&gt;"tag_UndetecCount",&lt;/P&gt;&lt;P&gt;"tag_InternalID"&lt;/P&gt;&lt;P&gt;FROM ( SELECT tag_UID a, MAX(tag_ChangeDate) AS Max_Datetime&lt;/P&gt;&lt;P&gt;FROM PTag.dbo."Tag_Data"&lt;/P&gt;&lt;P&gt;where tag_changer is not null and tag_changer not in ('null')&lt;/P&gt;&lt;P&gt;GROUP BY tag_UID) AS x INNER JOIN&lt;/P&gt;&lt;P&gt;PTag.dbo."Tag_Data" ON&lt;/P&gt;&lt;P&gt;x.a = tag_UID and x.Max_Datetime=tag_ChangeDate and tag_ProdDate &amp;gt;= '01/01/2021' ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=================================================================================&lt;/P&gt;&lt;P&gt;Now, how should i achieve the below qliksense tranforamtion in the above script:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;tag_UID,&lt;BR /&gt;tag_Material,&lt;BR /&gt;tag_Mat_Description,&lt;BR /&gt;tag_SkidID,&lt;BR /&gt;tag_LogicalSkidID,&lt;BR /&gt;tag_SkidPosition,&lt;BR /&gt;tag_Version,&lt;BR /&gt;tag_Color,&lt;BR /&gt;IF( "tag_Color" = 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_mold,&lt;BR /&gt;IF( "tag_Color" &amp;lt;&amp;gt; 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_paint,&lt;BR /&gt;"tag_UID" &amp;amp; "tag_ChangeDate" as Key,&lt;BR /&gt;tag_Changer,&lt;BR /&gt;tag_ChangeDate,&lt;BR /&gt;tag_TrolleyID,&lt;BR /&gt;tag_Undetected,&lt;BR /&gt;tag_Mold,&lt;BR /&gt;tag_Cavity,&lt;BR /&gt;tag_ProdDate,&lt;BR /&gt;tag_UndetecCount,&lt;BR /&gt;tag_InternalID&lt;BR /&gt;FROM [.......qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;A:&lt;BR /&gt;Mapping&lt;BR /&gt;Load Key as Key1, tag_TrolleyID_mold Resident Data;&lt;/P&gt;&lt;P&gt;B:&lt;BR /&gt;Mapping&lt;BR /&gt;Load Key as Key2, tag_TrolleyID_paint Resident Data;&lt;/P&gt;&lt;P&gt;D :&amp;nbsp;&lt;BR /&gt;Load Distinct tag_UID Resident Data;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key1,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_mold&lt;BR /&gt;Resident Data where tag_Color = 'NULL' group by tag_UID; //tag_Color;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;tag_UID,&lt;BR /&gt;//tag_Color ,&lt;BR /&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key2,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_paint&lt;BR /&gt;Resident Data where tag_Color &amp;lt;&amp;gt; 'NULL' group by tag_UID ;//tag_Color;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *,&lt;BR /&gt;ApplyMap('A', key1, '-') as tag_TrolleyID_mold,&lt;BR /&gt;ApplyMap('B', key2, '-') as tag_TrolleyID_paint&lt;BR /&gt;Resident D;&lt;BR /&gt;&lt;BR /&gt;drop tables Data, D;&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;I need to do the qliksense script logic in the sql query in order to combine the result in one extractor. Insted of first extracting the data into qvd and then transformin it.&lt;/P&gt;&lt;P&gt;I tried the syntax that you gave earlier but i am unable to achieve it.&lt;/P&gt;&lt;P&gt;Can you please help as i am stuck on it from a long time now ? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Please help&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 11:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791357#M61874</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-15T11:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791561#M61910</link>
      <description>&lt;P&gt;Hi , can anyone please help on this ? Please !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 19:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791561#M61910</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-15T19:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming SQL syntax in qliksense script</title>
      <link>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791704#M61927</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49688"&gt;@berkarmagan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your query but it is giving me syntax error:-&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD *,&lt;/P&gt;&lt;P&gt;IF( "tag_Color" = 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_mold,&lt;BR /&gt;IF( "tag_Color" &amp;lt;&amp;gt; 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_paint,&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;SQL (SELECT&lt;/P&gt;&lt;P&gt;*&lt;BR /&gt;&lt;BR /&gt;FROM PTag.dbo."Tag_Data"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;where tag_changer is not null and tag_changer not in ('null') and tag_changer not like 'Undetected%' and&lt;/P&gt;&lt;P&gt;tag_UID='555338334d8492330021021805073101' and tag_TrolleyID &amp;lt;&amp;gt;''and tag_ProdDate &amp;gt;='01/01/2021'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;) AS x LEFT JOIN on&lt;/P&gt;&lt;P&gt;PTag.dbo."Tag_Data"&lt;/P&gt;&lt;P&gt;(tag_UID,&lt;BR /&gt;convert(nvarhcar(10),tag_UID) +''+ convert(nvarhcar(10),max(tag_ChangeDate)) as key1,&lt;BR /&gt;max(tag_ChangeDate) as Datetime_mold&lt;BR /&gt;from Data where tag_Color = 'NULL' group by tag_UID)y on y.tag_UID=x.tag_UID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please tell&amp;nbsp; me what i did wrong ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 08:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Transforming-SQL-syntax-in-qliksense-script/m-p/1791704#M61927</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-16T08:56:25Z</dc:date>
    </item>
  </channel>
</rss>

