<?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: Comparing an Aggr() function to a single value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940020#M324258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot include Column(3) in a Sum(). Replace "Column(3)" with the expression for column 3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2015 10:02:34 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2015-09-25T10:02:34Z</dc:date>
    <item>
      <title>Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940015#M324253</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;Something is not working with my expression but I can't see why...I need a fresh persepective please!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the table below, I am calculating the average number of logons (and std. dev) per student on a course - I then calculate the avg minus 1 std. dev (Column(1) - Column(2)). What I want to do now is find out how many students have an average number of logons that fall below the threshold of this calculated value. As you can see, the expression (highlighted in red) returns 0; however in the next column you can see that I have the same expression and just hard-coded the value of 1.39 and it gives the correct expected results of 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Course Name&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Mode of Attendance Group&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Year / Level of Course Description&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;avg&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;std&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Column(1) - Column(2)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG style="color: #ff0000;"&gt;=Sum(if( aggr(sum({$&amp;lt; [Log Year] = {2014} &amp;gt;} vol) / 20, [Student ID]) &amp;lt; column(3), 1, 0)) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;=Sum(if( aggr(sum({$&amp;lt; [Log Year] = {2014} &amp;gt;} vol) / 20, [Student ID]) &amp;lt; 1.39, 1, 0)) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;2.64 &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;1.25 &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;1.39 &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;BSC HONS BUSINESS&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Full Time&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff" nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;1 - 1st Year&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2.64&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1.25&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1.39&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case there was something 'odd' about the calculations for avg and std. dev I tried replacing them with hard-coded figures too, and still get the same results. So it seem to be pointing to how I reference 'Column(3)'...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts welcome...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Azam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:21:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940015#M324253</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2015-09-25T09:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940016#M324254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;column(1)-column(2)&amp;nbsp;&amp;nbsp; change column name as Gap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and write the expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(if(aggr(sum({$&amp;lt;[log year]={2014}&amp;gt;}vol/20,[student ID]) ,&amp;lt; gap,1,0))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940016#M324254</guid>
      <dc:creator>stephenedberkg</dc:creator>
      <dc:date>2015-09-25T09:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940017#M324255</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;Thanks, but no change to the results...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Azam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940017#M324255</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2015-09-25T09:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940018#M324256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.39 instead of use what you write the expression in column 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=sum(if(aggr(sum({$&amp;lt;[log year]={2014}&amp;gt;} vol/20,[student ID]) &amp;lt; gap,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940018#M324256</guid>
      <dc:creator>stephenedberkg</dc:creator>
      <dc:date>2015-09-25T09:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940019#M324257</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;If it helps, I've mocked up a test example that reproduces the 'issue'...(can't share the original...sensitive data etc..)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Azam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:59:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940019#M324257</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2015-09-25T09:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940020#M324258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot include Column(3) in a Sum(). Replace "Column(3)" with the expression for column 3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 10:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940020#M324258</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-09-25T10:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940021#M324259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(if(sum(Vol) &amp;lt; avg(total Vol) - Stdev(total Vol), 1, 0), Student))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 10:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940021#M324259</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-09-25T10:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing an Aggr() function to a single value</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940022#M324260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Simen... that has solved my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 10:25:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-an-Aggr-function-to-a-single-value/m-p/940022#M324260</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2015-09-25T10:25:34Z</dc:date>
    </item>
  </channel>
</rss>

