<?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: expression in script - Meaning in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885265#M992557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous() will return the value of the given column in the previous row, in the script we are calculating the Cumulative sales based on the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If previous key value and the current key value is same then we are doing the sum of those values, otherwise we are starting the calculation again with the Current Quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2015 03:52:54 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2015-07-06T03:52:54Z</dc:date>
    <item>
      <title>expression in script - Meaning</title>
      <link>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885264#M992556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;What is the meaning of the expression in script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt; if(KEY = previous(KEY), Rangesum(Quantity, peek(CumulSales)), Quantity) as CumulSales,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2020 18:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885264#M992556</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2020-11-20T18:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: expression in script - Meaning</title>
      <link>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885265#M992557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous() will return the value of the given column in the previous row, in the script we are calculating the Cumulative sales based on the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If previous key value and the current key value is same then we are doing the sum of those values, otherwise we are starting the calculation again with the Current Quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 03:52:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885265#M992557</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-07-06T03:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: expression in script - Meaning</title>
      <link>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885266#M992558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check with below example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;KEY &lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Quantity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1, 10&lt;/P&gt;&lt;P&gt;1, 20&lt;/P&gt;&lt;P&gt;1, 15&lt;/P&gt;&lt;P&gt;2, 5&lt;/P&gt;&lt;P&gt;2, 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If(KEY = previous(KEY), Rangesum(Quantity, peek(CumulSales)), Quantity) as CumulSales&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM DataSource&lt;/P&gt;&lt;P&gt;ORDER BY KEY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output of above script&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;KEY &lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Quantity, &lt;SPAN style="color: #000080; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;CumulSales&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1, 10, 10&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1, 20, 30&amp;nbsp;&amp;nbsp; (10 +20)&amp;nbsp; (Since previous key is 1 = Current key 1)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;1, 15, 45&amp;nbsp;&amp;nbsp; (30 + 15)&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;(Since previous key is 1 = Current key 1) Peek(CumuSales)&amp;nbsp; = 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;2, 5, 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (5) (Here the Previous Key is 1 &amp;lt;&amp;gt; Current Key 2) So gettting only current quantity.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;2, 4, 9&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt; (5+ 4)&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;(Since previous key is 2 = Current key 2) Peek(CumuSales)&amp;nbsp; = 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hope this helps you.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 03:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885266#M992558</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-07-06T03:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: expression in script - Meaning</title>
      <link>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885267#M992559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/people/jagan"&gt;jagan&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got it. Thank you so much for the detailed explanation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 04:31:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-in-script-Meaning/m-p/885267#M992559</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2015-07-06T04:31:13Z</dc:date>
    </item>
  </channel>
</rss>

