<?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: Variance Calculation in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052627#M1253969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As requested please find attached,once again I would want the variance calculated in the script to enable me create ranges using in the class function in the pivot table or it there's any other way to achieve that I'd really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 09:59:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-01T09:59:05Z</dc:date>
    <item>
      <title>Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052622#M1253954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to calculate the variance in the following script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=NUM(SUM(vCurrentDate) Amount - SUM(vPreviousDate) Amount) /&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;SUM(vPreviousDate) Amount&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where &lt;STRONG&gt;vCurrentDate&lt;/STRONG&gt; and &lt;STRONG&gt;vPreviousDate&lt;/STRONG&gt; are variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would i calculate the variance in the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fifi Nokoe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052622#M1253954</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052623#M1253958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide a sample with expected output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 19:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052623#M1253958</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-29T19:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052624#M1253962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So essentially I would want the output as field name, in order to use the class function to create variance ranges because i can't seem to use the expression below expression in the calculated expression with the class function&amp;nbsp; ie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=NUM(SUM(vCurrentDate) Amount - SUM(vPreviousDate) Amount) /&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;SUM(vPreviousDate) Amount as Myfield&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 07:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052624#M1253962</guid>
      <dc:creator />
      <dc:date>2016-03-01T07:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052625#M1253964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest, if you want to calculate Variance with Current Data and Previous data, Using Set analysis you can do it easily at UI...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chekc this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9162"&gt;Set Analysis for certain Point in Time&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9144"&gt;Set Analysis for Rolling Periods&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else share a Sample as asked by Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 07:42:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052625#M1253964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T07:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052626#M1253967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scripting we do to model and transform the data in the data tables so that desired KPIs can be shown through charts. If you need variance calculation against specified dimensions/fields in script, you need to use sum, group by, peek/previous kind of functions in the script. Please share sample data and script to help further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 07:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052626#M1253967</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-03-01T07:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052627#M1253969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As requested please find attached,once again I would want the variance calculated in the script to enable me create ranges using in the class function in the pivot table or it there's any other way to achieve that I'd really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 09:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052627#M1253969</guid>
      <dc:creator />
      <dc:date>2016-03-01T09:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052628#M1253976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this look like what you wanted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/116425_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TEMP:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CrossTable(DATE, BALANCE)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD CustomerName, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [42427], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [42428], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [42429]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[DATA_FILE.xlsx]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOCONCATENATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FINAL_TABLE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD DATE,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; CustomerName,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; If(CustomerName = Peek('CustomerName'), (SUM(BALANCE) - SUM(Alt(Previous(BALANCE), 0)))/SUM(Alt(Previous(BALANCE), 1)), 0) AS VarianceBalance&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GROUP BY DATE, CustomerName;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD DATE(NUM#(DATE),'dd/MM/yyyy') AS DATE,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BALANCE,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESIDENT TEMP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By CustomerName, DATE;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE TEMP;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052628#M1253976</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-01T12:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Variance Calculation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052629#M1253978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow thanks a lot Sunny! I'm satisfied now really appreciated the help. Thanks to everyone else for sharing and commenting. Fifi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:12:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variance-Calculation-in-Script/m-p/1052629#M1253978</guid>
      <dc:creator />
      <dc:date>2016-03-01T14:12:36Z</dc:date>
    </item>
  </channel>
</rss>

