<?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 for Per Hour Calculations (Puzzling) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393680#M488038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a Variable called "Worked Hours" which is a count of distinct days of the month that have stats, meaning our agents worked that day. We add 8 hours of time to each day worked to calculated their stats off of. So in short, each day the Worked Hours are increasing by 8 and I want to be able to&amp;nbsp; use this accumulative total to calculate their stats. The Variable is below and in this example there are 24 worked days so far for a total of 192 hours. &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32965" class="jive-image-thumbnail jive-image" onclick="" alt="1.JPG" src="https://community.qlik.com/legacyfs/online/32965_1.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the "Agent Accts Worked" being calculated off of &lt;STRONG&gt;sum(if(DISPO&amp;gt;=2000,1,0)), &lt;/STRONG&gt;which gives me 3,228 accounts. So I am trying to calculate 3,228 divided by the 192 (or whatever the accumulation is that day). I should be getting 16.8 Agent Accounts Worked Per Hour. Instead I am getting the below and I am not sure what I should change to make this work daily. &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32966" class="jive-image" alt="2.JPG" src="https://community.qlik.com/legacyfs/online/32966_2.JPG" /&gt;&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**When I just add the Variable into the Expression itself it works, but it only calculates off of the accumulative hours that THAT agent worked for the month, when I need the total amount of days &lt;STRONG&gt;X&lt;/STRONG&gt; 8 that were worked that month...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32967" class="jive-image-thumbnail jive-image" onclick="" alt="3.JPG" src="https://community.qlik.com/legacyfs/online/32967_3.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Feb 2013 15:31:09 GMT</pubDate>
    <dc:creator>MalcolmCICWF</dc:creator>
    <dc:date>2013-02-01T15:31:09Z</dc:date>
    <item>
      <title>Using Variable for Per Hour Calculations (Puzzling)</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393680#M488038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a Variable called "Worked Hours" which is a count of distinct days of the month that have stats, meaning our agents worked that day. We add 8 hours of time to each day worked to calculated their stats off of. So in short, each day the Worked Hours are increasing by 8 and I want to be able to&amp;nbsp; use this accumulative total to calculate their stats. The Variable is below and in this example there are 24 worked days so far for a total of 192 hours. &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32965" class="jive-image-thumbnail jive-image" onclick="" alt="1.JPG" src="https://community.qlik.com/legacyfs/online/32965_1.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the "Agent Accts Worked" being calculated off of &lt;STRONG&gt;sum(if(DISPO&amp;gt;=2000,1,0)), &lt;/STRONG&gt;which gives me 3,228 accounts. So I am trying to calculate 3,228 divided by the 192 (or whatever the accumulation is that day). I should be getting 16.8 Agent Accounts Worked Per Hour. Instead I am getting the below and I am not sure what I should change to make this work daily. &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32966" class="jive-image" alt="2.JPG" src="https://community.qlik.com/legacyfs/online/32966_2.JPG" /&gt;&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**When I just add the Variable into the Expression itself it works, but it only calculates off of the accumulative hours that THAT agent worked for the month, when I need the total amount of days &lt;STRONG&gt;X&lt;/STRONG&gt; 8 that were worked that month...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="32967" class="jive-image-thumbnail jive-image" onclick="" alt="3.JPG" src="https://community.qlik.com/legacyfs/online/32967_3.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 15:31:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393680#M488038</guid>
      <dc:creator>MalcolmCICWF</dc:creator>
      <dc:date>2013-02-01T15:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable for Per Hour Calculations (Puzzling)</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393681#M488039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hard to say exactly what's wrong without being able to see the data or the document your working on.&lt;/P&gt;&lt;P&gt;It looks like your variable Working Hours is evaluated for every agent instead of once for the document. Adding an = sign in front of the expression should solve that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count({&amp;lt;DISPO={"&amp;gt;=2000"}&amp;gt;} DISPO) / (count(&lt;STRONG&gt;total &lt;/STRONG&gt;distinct [Call Start Time])*8)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;total&lt;/STRONG&gt; keyword should make sure the count is over all agents.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 17:44:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393681#M488039</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-02-01T17:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable for Per Hour Calculations (Puzzling)</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393682#M488040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using the TOTAL did indeed work! thanks for taking the time to help me figure this out!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 22:08:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-for-Per-Hour-Calculations-Puzzling/m-p/393682#M488040</guid>
      <dc:creator>MalcolmCICWF</dc:creator>
      <dc:date>2013-02-01T22:08:04Z</dc:date>
    </item>
  </channel>
</rss>

