<?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: Qliksense logic in to sql script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791652#M61920</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand you correctly, it seems you have a Qlik Sense script and you want to convert it into a SQL query preserving all the features implemented in QlikSense;&amp;nbsp; If that is your question, perhaps you should ask it in any of the SQL forums; my advice is to create a view in the SQL Server implementing all the QS logic over there, but, if that is what you want, you are in the wrong group.&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 05:30:09 GMT</pubDate>
    <dc:creator>ArnadoSandoval</dc:creator>
    <dc:date>2021-03-16T05:30:09Z</dc:date>
    <item>
      <title>Qliksense logic in to sql script</title>
      <link>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791647#M61917</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have below transformed&amp;nbsp; sql in qliksense script :-&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *; 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,&lt;/P&gt;&lt;P&gt;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') GROUP BY tag_UID)&lt;/P&gt;&lt;P&gt;AS x INNER JOIN PTag.dbo."Tag_Data" ON 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;/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;/P&gt;&lt;P&gt;LOAD&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;IF( "tag_Color" = 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_mold,&lt;/P&gt;&lt;P&gt;IF( "tag_Color" &amp;lt;&amp;gt; 'NULL', "tag_TrolleyID" ) as tag_TrolleyID_paint,&lt;/P&gt;&lt;P&gt;"tag_UID" &amp;amp; "tag_ChangeDate" as Key,&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 [.......qvd] (qvd);&lt;/P&gt;&lt;P&gt;A:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;Load Key as Key1,&lt;/P&gt;&lt;P&gt;tag_TrolleyID_mold&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;B:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;Load Key as Key2,&lt;/P&gt;&lt;P&gt;tag_TrolleyID_paint&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;D :&lt;/P&gt;&lt;P&gt;Load Distinct tag_UID&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load tag_UID,&lt;/P&gt;&lt;P&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key1,&lt;/P&gt;&lt;P&gt;max(tag_ChangeDate) as Datetime_mold&lt;/P&gt;&lt;P&gt;Resident Data where tag_Color = 'NULL' group by tag_UID;&lt;/P&gt;&lt;P&gt;left join(D)&lt;/P&gt;&lt;P&gt;Load tag_UID,&lt;/P&gt;&lt;P&gt;tag_UID &amp;amp; max(tag_ChangeDate) as key2,&lt;/P&gt;&lt;P&gt;max(tag_ChangeDate) as Datetime_paint&lt;/P&gt;&lt;P&gt;Resident Data where tag_Color &amp;lt;&amp;gt; 'NULL' group by tag_UID ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Final:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;ApplyMap('A', key1, '-') as tag_TrolleyID_mold,&lt;/P&gt;&lt;P&gt;ApplyMap('B', key2, '-') as tag_TrolleyID_paint&lt;/P&gt;&lt;P&gt;Resident D;&lt;/P&gt;&lt;P&gt;drop tables Data,&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. I tried the syntax that you gave earlier but i am unable to achieve it. 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;</description>
      <pubDate>Tue, 16 Mar 2021 04:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791647#M61917</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-16T04:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Qliksense logic in to sql script</title>
      <link>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791652#M61920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/103918"&gt;@Aspiring_Developer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand you correctly, it seems you have a Qlik Sense script and you want to convert it into a SQL query preserving all the features implemented in QlikSense;&amp;nbsp; If that is your question, perhaps you should ask it in any of the SQL forums; my advice is to create a view in the SQL Server implementing all the QS logic over there, but, if that is what you want, you are in the wrong group.&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 05:30:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791652#M61920</guid>
      <dc:creator>ArnadoSandoval</dc:creator>
      <dc:date>2021-03-16T05:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Qliksense logic in to sql script</title>
      <link>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791858#M61940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/5298"&gt;@ArnadoSandoval&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below&amp;nbsp; sql query.&lt;/P&gt;&lt;P&gt;With Uids AS (&lt;BR /&gt;SELECT&lt;BR /&gt;distinct t.tag_UID -- Field to be used as a join field on the data model&lt;BR /&gt;FROM dbo.Tag_Data AS t&lt;BR /&gt;where 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;= '02/18/2021'&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;LastDateMold AS (&lt;BR /&gt;SELECT&lt;BR /&gt;t.tag_UID -- Field to be used as a join field on the data model&lt;BR /&gt;, MAX(t.tag_ChangeDate)as Last_Date&lt;BR /&gt;FROM dbo.Tag_Data AS t&lt;BR /&gt;where tag_Color = 'NULL'&lt;BR /&gt;and 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;= '02/18/2021'&lt;BR /&gt;GROUP BY tag_UID&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;LastDatePaint AS (&lt;BR /&gt;SELECT&lt;BR /&gt;t.tag_UID -- Field to be used as a join field on the data model&lt;BR /&gt;, MAX(t.tag_ChangeDate)as Last_Date&lt;BR /&gt;FROM dbo.Tag_Data AS t&lt;BR /&gt;where tag_Color != 'NULL'&lt;BR /&gt;and 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;= '02/18/2021'&lt;BR /&gt;GROUP BY tag_UID&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;t.tag_UID&lt;BR /&gt;,m.tag_UID&lt;BR /&gt;,p.tag_UID&lt;BR /&gt;,tag1.tag_UID&lt;BR /&gt;,tag2.tag_UID&lt;BR /&gt;,tag1.tag_TrolleyID&lt;BR /&gt;,tag2.tag_TrolleyID&lt;BR /&gt;,tag1.tag_ChangeDate&lt;BR /&gt;,tag2.tag_ChangeDate&lt;BR /&gt;FROM UIDs as t&lt;BR /&gt;LEFT JOIN LastDateMold m on t.tag_UID = m.tag_UID&lt;BR /&gt;LEFT JOIN LastDatePaint p on t.tag_UID = p.tag_UID&lt;BR /&gt;LEFT JOIN dbo.Tag_Data tag1 on m.tag_UID = tag1.tag_UID and m.Last_Date = tag1.tag_ChangeDate&lt;BR /&gt;LEFT JOIN dbo.Tag_Data tag2 on p.tag_UID = tag2.tag_UID and p.Last_Date = tag2.tag_ChangeDate&lt;BR /&gt;--where t.tag_UID = '555338334d8052220021021812584701'&lt;BR /&gt;--where tag1.tag_TrolleyID is not null&lt;BR /&gt;-- and tag2.tag_TrolleyID is not null&lt;/P&gt;&lt;P&gt;Can you please tell me how can i run the same script in qliksense ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now i am getting multiple errors.&lt;/P&gt;&lt;P&gt;Please help !!!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 14:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qliksense-logic-in-to-sql-script/m-p/1791858#M61940</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-03-16T14:06:28Z</dc:date>
    </item>
  </channel>
</rss>

