<?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: Aggr if statement in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1528595#M438589</link>
    <description>&lt;P&gt;a colleague at work was able to help me .&amp;nbsp; &amp;nbsp; &amp;nbsp;My formula was working but the inner FTE calc was factoring in the cost center and thus the result of that calc was less than my $(FTE_Threshold) variable.&lt;/P&gt;&lt;P&gt;I had to add this&amp;nbsp;&lt;SPAN&gt;{&amp;lt;[CostCenter]=&amp;gt;}&amp;nbsp; to my inner sum, so that the calculation ignores the cost center in the calculation&amp;nbsp;and when it evaluated if the result is less than my FTE threshold variable .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Count({$&amp;lt;[Employee] = {"=&lt;BR /&gt;(&lt;BR /&gt;Round(&lt;BR /&gt;Sum(&lt;BR /&gt;Aggr(&lt;BR /&gt;(sum({&amp;lt;[CostCenter]=&amp;gt;}[EmployeeTimeMetrics] )/(($(vCountOfDays)*(40/7)))&lt;BR /&gt;)&lt;BR /&gt;,[Employee]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;, 0.01 )&lt;BR /&gt;&lt;BR /&gt;) &amp;gt;$(FTE_Threshhold_Variable)"}&amp;gt;} Distinct [Employee])&lt;/P&gt;&lt;P&gt;Now everything works great.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2019 19:23:50 GMT</pubDate>
    <dc:creator>mkamal</dc:creator>
    <dc:date>2019-01-09T19:23:50Z</dc:date>
    <item>
      <title>Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439889#M432169</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;&lt;/P&gt;&lt;P&gt;I have a trans table that has users with an amount of airtime that has been used. I split this by month and the user groups. Now i want to count in a expression the distinct amount of users that used more than R30 for a month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i have a pivot table with my dimensions as Report Group (the group/ customer name) and the month the usage of airtime took place. So i want to show for each month how many users have used more than R30. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below &lt;SPAN style="font-size: 13.3333px;"&gt;expression i am using but is not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=IF(&lt;SPAN style="font-size: 13.3333px;"&gt;AGGR&lt;/SPAN&gt;(sum(AIRTIME_AMOUNT) &amp;gt; 'R30.00',USER_ID) , Count(DISTINCT(USER_ID)))&lt;/P&gt;&lt;P&gt;Please note i am not using USER_ID as a &lt;SPAN style="font-size: 13.3333px;"&gt;dimensions (Too much information 3mil + lines) as i only want a total count of users by month and group. Not sure if there is a way to do it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;STM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 07:51:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439889#M432169</guid>
      <dc:creator>stevietm</dc:creator>
      <dc:date>2017-10-12T07:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439890#M432170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Try this?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(Aggr(Count(If(Sum(AIRTIME_AMOUNT) &amp;gt; 'R30.00', USER_ID) DISTINCT USER_ID), USER_ID))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 07:55:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439890#M432170</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-12T07:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439891#M432171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gives error in expression, I try to change it but i don,t get a value back&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 08:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439891#M432171</guid>
      <dc:creator>stevietm</dc:creator>
      <dc:date>2017-10-12T08:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439892#M432172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;USER_ID = {"=Sum(AIRTIME_AMOUNT) &amp;gt; 30"}&amp;gt;} Distinct USER_ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 08:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439892#M432172</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2017-10-12T08:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439893#M432173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can u try like this? &lt;/P&gt;&lt;P&gt;=Sum(Aggr(If(sum(AIRTIME_AMOUNT)&amp;gt;'R30.00',USER_ID), Count(DISTINCT(USER_ID))))&lt;/P&gt;&lt;P&gt;is your AIRTIME_AMOUNT &amp;gt;'R30.00' correct condition ? if it's numeric just try &amp;gt;30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 08:03:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439893#M432173</guid>
      <dc:creator>devarasu07</dc:creator>
      <dc:date>2017-10-12T08:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439894#M432174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does R30.00 returns Flag, Can you check using Filter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 08:05:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1439894#M432174</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-12T08:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1528479#M438581</link>
      <description>&lt;P&gt;This formula worked for one of my apps.&amp;nbsp; there is one issue.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;If I click on one of the cost center values in the table.&amp;nbsp; &amp;nbsp; the&amp;nbsp; charttable's contents become blank&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula I used:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;[Employee] = {"=&lt;BR /&gt;(&lt;BR /&gt;Round(&lt;BR /&gt;Sum(&lt;BR /&gt;Aggr(&lt;BR /&gt;(sum([Employee FTE Calculation] )/(($(vCountOfDays)*(40/7)))&lt;BR /&gt;)&lt;BR /&gt;,[Employee]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;, 0.01 )&lt;BR /&gt;&lt;BR /&gt;) &amp;gt;&lt;SPAN&gt;$(vFTE_Threshold)&lt;/SPAN&gt;"}&amp;gt;} Distinct [Employee])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The chart table looks like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Cost Center|&amp;nbsp; Above Expression&lt;/P&gt;&lt;P&gt;100000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;20000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I click on one of the cost center values in the table.&amp;nbsp; &amp;nbsp; the table then looks like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cost Center |&amp;nbsp;&lt;/STRONG&gt; &lt;STRONG&gt;Above Expression&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dimension Cost center lives in the main table of the data model, how the "above expression" is in a table that links to the main table.&lt;/P&gt;&lt;P&gt;any idea on how can I correct this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 15:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1528479#M438581</guid>
      <dc:creator>mkamal</dc:creator>
      <dc:date>2019-01-09T15:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr if statement in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1528595#M438589</link>
      <description>&lt;P&gt;a colleague at work was able to help me .&amp;nbsp; &amp;nbsp; &amp;nbsp;My formula was working but the inner FTE calc was factoring in the cost center and thus the result of that calc was less than my $(FTE_Threshold) variable.&lt;/P&gt;&lt;P&gt;I had to add this&amp;nbsp;&lt;SPAN&gt;{&amp;lt;[CostCenter]=&amp;gt;}&amp;nbsp; to my inner sum, so that the calculation ignores the cost center in the calculation&amp;nbsp;and when it evaluated if the result is less than my FTE threshold variable .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Count({$&amp;lt;[Employee] = {"=&lt;BR /&gt;(&lt;BR /&gt;Round(&lt;BR /&gt;Sum(&lt;BR /&gt;Aggr(&lt;BR /&gt;(sum({&amp;lt;[CostCenter]=&amp;gt;}[EmployeeTimeMetrics] )/(($(vCountOfDays)*(40/7)))&lt;BR /&gt;)&lt;BR /&gt;,[Employee]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;, 0.01 )&lt;BR /&gt;&lt;BR /&gt;) &amp;gt;$(FTE_Threshhold_Variable)"}&amp;gt;} Distinct [Employee])&lt;/P&gt;&lt;P&gt;Now everything works great.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 19:23:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-if-statement-in-expression/m-p/1528595#M438589</guid>
      <dc:creator>mkamal</dc:creator>
      <dc:date>2019-01-09T19:23:50Z</dc:date>
    </item>
  </channel>
</rss>

