<?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 Using Variable in a calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444052#M557685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to calculate system up time in a table in my dashboard. I have created a variable in the load script to determine how many minutes have passed since the beginning of the Fiscal year which starts on 10/1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let MinutesThisFY=interval(now()-(YearStart(Now(), 0, 10)),'mm');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My source for this is currently a spreadsheet which has a line for every outage, grouped by system. Which means for any given system, there could be multiple outages to be aggregated. In the spreadsheet it has, among other columsn, a start time column, and end time column, and a column that calculates the difference between the start time and end time in minutes (column is called Minutes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Straight Table object I have the System as the dimension, then as Expressions I have the Total Time, the MinutesThisFY, and the difference between the two in three columns. The first two show up correctly, but the calculation give me very strange results. The calculation I'm using is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=MinutesThisFY - sum(Minutes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the results I'm seeing are like this:&lt;/P&gt;&lt;P&gt;Sum(Minutes) = 8575&lt;/P&gt;&lt;P&gt;MinutesThisFY = 356663&lt;/P&gt;&lt;P&gt;MinutesThisFY - sum(Minutes) = &lt;SPAN style="color: #ff0000;"&gt;-8327.31715277777&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;(Instead of 348088 like I'm expecting)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Can someone help me figure out where I'm going wrong? Thank you!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jun 2013 23:46:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-05T23:46:04Z</dc:date>
    <item>
      <title>Using Variable in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444052#M557685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to calculate system up time in a table in my dashboard. I have created a variable in the load script to determine how many minutes have passed since the beginning of the Fiscal year which starts on 10/1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let MinutesThisFY=interval(now()-(YearStart(Now(), 0, 10)),'mm');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My source for this is currently a spreadsheet which has a line for every outage, grouped by system. Which means for any given system, there could be multiple outages to be aggregated. In the spreadsheet it has, among other columsn, a start time column, and end time column, and a column that calculates the difference between the start time and end time in minutes (column is called Minutes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Straight Table object I have the System as the dimension, then as Expressions I have the Total Time, the MinutesThisFY, and the difference between the two in three columns. The first two show up correctly, but the calculation give me very strange results. The calculation I'm using is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=MinutesThisFY - sum(Minutes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the results I'm seeing are like this:&lt;/P&gt;&lt;P&gt;Sum(Minutes) = 8575&lt;/P&gt;&lt;P&gt;MinutesThisFY = 356663&lt;/P&gt;&lt;P&gt;MinutesThisFY - sum(Minutes) = &lt;SPAN style="color: #ff0000;"&gt;-8327.31715277777&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;(Instead of 348088 like I'm expecting)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Can someone help me figure out where I'm going wrong? Thank you!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 23:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444052#M557685</guid>
      <dc:creator />
      <dc:date>2013-06-05T23:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444053#M557686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use dollar sign expansion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(MinutesThisFY) - sum(Minutes) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 01:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444053#M557686</guid>
      <dc:creator>calvindk</dc:creator>
      <dc:date>2013-06-06T01:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable in a calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444054#M557687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doh! Thanks Anders! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Figured it had to be something simple. Thanks for your reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-in-a-calculation/m-p/444054#M557687</guid>
      <dc:creator />
      <dc:date>2013-06-06T15:29:35Z</dc:date>
    </item>
  </channel>
</rss>

