<?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: Change sql code to qlik script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411445#M94652</link>
    <description>&lt;P&gt;It seems you have forgot to paste the code! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2024 14:05:04 GMT</pubDate>
    <dc:creator>Adam_Romanowski</dc:creator>
    <dc:date>2024-01-26T14:05:04Z</dc:date>
    <item>
      <title>Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411433#M94651</link>
      <description>&lt;P&gt;How can i change this sql code to qlik script?&lt;/P&gt;
&lt;P&gt;Giriş miktarı hesaplama&lt;/P&gt;
&lt;P&gt;(SELECT Sum(Nvl(yedmik,0) + Nvl(yedbmk,0) - Nvl(yedimk,0) - Nvl(yedibm,0)) FROM satyed,satsvd WHERE yedkun = svdunq AND svdkun = spdunq)&lt;/P&gt;
&lt;P&gt;Çıkış miktarı hesaplama&lt;/P&gt;
&lt;P&gt;(SELECT Sum(Nvl(cldmik,0) + Nvl(cldbmk,0)) cldmik FROM satcld,satsvd WHERE cldkun = svdunq AND svdkun = spdunq)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411433#M94651</guid>
      <dc:creator>sevvalk</dc:creator>
      <dc:date>2024-11-15T21:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411445#M94652</link>
      <description>&lt;P&gt;It seems you have forgot to paste the code! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 14:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411445#M94652</guid>
      <dc:creator>Adam_Romanowski</dc:creator>
      <dc:date>2024-01-26T14:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411450#M94653</link>
      <description>&lt;P&gt;I am so so sorry&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;. I added.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 14:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411450#M94653</guid>
      <dc:creator>sevvalk</dc:creator>
      <dc:date>2024-01-26T14:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411520#M94661</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/246588"&gt;@sevvalk&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Basically it will be very similar both &lt;STRONG&gt;Where&lt;/STRONG&gt; | &lt;STRONG&gt;and&lt;/STRONG&gt; are already used within the Load.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Example &lt;STRONG&gt;where | and&lt;/STRONG&gt;, documentation below&lt;BR /&gt;&lt;A href="https://help.qlik.com/pt-BR/cloud-services/Subsystems/Hub/Content/Sense_Hub/Tutorials/reduce-data.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/pt-BR/cloud-services/Subsystems/Hub/Content/Sense_Hub/Tutorials/reduce-data.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatheusC_0-1706297406487.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158470i3BAD2CA8B83D6306/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatheusC_0-1706297406487.png" alt="MatheusC_0-1706297406487.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe that you will only have to change the question of the Nvl that we could be using the Isnull, as an example below:&lt;/P&gt;
&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Tradução" data-ved="2ahUKEwj9sKfy4fuDAxWUqZUCHcgqDBgQ3ewLegQIBRAQ"&gt;&lt;SPAN class="Y2IQFc"&gt;if(isnull(yedmik),0,yedmik)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;&lt;BR /&gt;Regarts,&lt;BR /&gt;Matheus&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 19:32:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411520#M94661</guid>
      <dc:creator>MatheusC</dc:creator>
      <dc:date>2024-01-26T19:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411621#M94671</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/246588"&gt;@sevvalk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You could try something along the following:&lt;/P&gt;
&lt;P&gt;// Load the data from the tables satyed and satsvd&lt;BR /&gt;satyed:&lt;BR /&gt;LOAD&lt;BR /&gt;yedkun,&lt;BR /&gt;yedmik,&lt;BR /&gt;yedbmk,&lt;BR /&gt;yedimk,&lt;BR /&gt;yedibm&lt;BR /&gt;FROM&lt;BR /&gt;[lib://satyed];&lt;/P&gt;
&lt;P&gt;satsvd:&lt;BR /&gt;LOAD&lt;BR /&gt;svdunq,&lt;BR /&gt;svdkun&lt;BR /&gt;FROM&lt;BR /&gt;[lib://satsvd];&lt;/P&gt;
&lt;P&gt;// Join the tables on the condition yedkun = svdunq&lt;BR /&gt;JOIN (satyed)&lt;BR /&gt;LOAD&lt;BR /&gt;svdunq as yedkun,&lt;BR /&gt;svdkun&lt;BR /&gt;RESIDENT satsvd;&lt;/P&gt;
&lt;P&gt;// Drop the table satsvd as it is no longer needed&lt;BR /&gt;DROP TABLE satsvd;&lt;/P&gt;
&lt;P&gt;// Calculate the sum of the expression using the If and IsNull functions&lt;BR /&gt;// The If function returns a value based on a condition&lt;BR /&gt;// The IsNull function checks if a value is null or not&lt;BR /&gt;LOAD&lt;BR /&gt;Sum(If(IsNull(yedmik), 0, yedmik) + If(IsNull(yedbmk), 0, yedbmk) - If(IsNull(yedimk), 0, yedimk) - If(IsNull(yedibm), 0, yedibm)) as Sum&lt;BR /&gt;RESIDENT satyed&lt;BR /&gt;WHERE svdkun = spdunq;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I would recommend you keep the SQL statement in your Qlik script with a proceeding Load statement:&lt;/P&gt;
&lt;P&gt;Load *;&lt;/P&gt;
&lt;P&gt;SQL&amp;nbsp;&lt;SPAN&gt;SELECT Sum(Nvl(yedmik,0) + Nvl(yedbmk,0) - Nvl(yedimk,0) - Nvl(yedibm,0)) FROM satyed,satsvd WHERE yedkun = svdunq AND svdkun = spdunq;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Letting the source database take care of joining and filtering values will improve performance both with regards to memory consumption as well as bandwidth usage.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Best Björn&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2024 19:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2411621#M94671</guid>
      <dc:creator>Bjorn_Wedbratt</dc:creator>
      <dc:date>2024-01-27T19:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2412536#M94749</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/246588"&gt;@sevvalk&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Did you get the solution?&lt;/P&gt;
&lt;P&gt;Close the topic with the solution met and leave a like if you found it useful.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 12:44:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2412536#M94749</guid>
      <dc:creator>MatheusC</dc:creator>
      <dc:date>2024-01-30T12:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change sql code to qlik script</title>
      <link>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2412539#M94751</link>
      <description>&lt;P&gt;Or, instead of writing a bunch of if() statements, you could just use RangeSum(Field1,Field2,Field3)... &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 12:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-sql-code-to-qlik-script/m-p/2412539#M94751</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-01-30T12:50:58Z</dc:date>
    </item>
  </channel>
</rss>

