<?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 Need help to create aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352733#M1175363</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use the below expression you will get the count of employee in range '90-100%'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Count({$&amp;lt;[Billing %]= {'90-100%'}&amp;gt;}([Billable Hours]/[Total Hours]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Iyyappan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Apr 2012 12:46:57 GMT</pubDate>
    <dc:creator>v_iyyappan</dc:creator>
    <dc:date>2012-04-16T12:46:57Z</dc:date>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352731#M1175361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar(Date, Year, Month)&lt;/P&gt;&lt;P&gt;Work ([Work ID], [Employee ID], Date, [Billable Hours], [Total Hours])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Billing % is calculated as following : Sum ([Billable Hours])/Sum ([Total Hours])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I create expressions that count how many employees have a Billing % in the 90-100 range? The table below visualizes what I am trying to achieve. The table should recalculate values based on the Calendar selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="1" cellspacing="0" class="jiveBorder" style="border-image: initial; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Billing % &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;distribution / employee&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Jan&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Feb&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Mar&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;90-100%&lt;/TD&gt;&lt;TD&gt;87&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;80-90%&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;70-80%&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0-70%&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: mikaelstoor&#xD;
Added Calendar table. Changed Month attribute in Work table to Date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 11:11:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352731#M1175361</guid>
      <dc:creator />
      <dc:date>2012-04-16T11:11:04Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352732#M1175362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the below code in application. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main1:&lt;/P&gt;&lt;P&gt;LOAD EmployeeID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BillableHours, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalHours&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Test.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Res_Main1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeID,TempBilling,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;0 and TempBilling &amp;lt;70,'0-70%',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=70 and TempBilling &amp;lt;80,'70-80%',&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; if(TempBilling&amp;gt;=80 and TempBilling &amp;lt;90,'80-90%',&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; If(TempBilling&amp;gt;=90 and TempBilling &amp;lt;100,'90-100%')))) as Billing;&lt;/P&gt;&lt;P&gt;LOAD EmployeeID,Sum(BillableHours)/Sum(TotalHours) as TempBilling&lt;/P&gt;&lt;P&gt;Resident Main1&lt;/P&gt;&lt;P&gt;Group By EmployeeID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Take a dimension as Billing in straight table and expression as Count(EmployeeID).&lt;/P&gt;&lt;P&gt;- But according the data as shown by you month wise, So you need create 12 expressions Jan,Feb,Mar.....Dec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Jan Exp -&amp;gt; Count({&amp;lt;Month={"Jan"}&amp;gt;}EmployeeID)&lt;/P&gt;&lt;P&gt;For Feb Exp -&amp;gt; Count({&amp;lt;Month={"Feb"}&amp;gt;}EmployeeID)&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Soon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 12:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352732#M1175362</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2012-04-16T12:05:28Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352733#M1175363</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use the below expression you will get the count of employee in range '90-100%'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Count({$&amp;lt;[Billing %]= {'90-100%'}&amp;gt;}([Billable Hours]/[Total Hours]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Iyyappan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 12:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352733#M1175363</guid>
      <dc:creator>v_iyyappan</dc:creator>
      <dc:date>2012-04-16T12:46:57Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352734#M1175364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realized, when I tried your solution, that I had over-simplified the problem. In reality I have a calender dimension. The table should calculate the Billing% ranges based on the selection in the Year list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calender(Date, Month, Year)&lt;/P&gt;&lt;P&gt;Work ([Work ID], [Employee ID], Date, [Billable Hours], [Total Hours])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your example calculates a grand total Billing%, not Billing% per year. I tried to introduce Year and month attributes in the "Res_Main1" attribute, but that leads to having two calendars in the document. I would like to avoid that. Any ideas how to solve the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 04:46:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352734#M1175364</guid>
      <dc:creator />
      <dc:date>2012-04-17T04:46:18Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352735#M1175365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Iyyappan V wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Count({$&amp;lt;[Billing %]= {'90-100%'}&amp;gt;}([Billable Hours]/[Total Hours]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It looks like your expression is based on the pre-aggregated table that Jagan Nalla suggested. Do you know how to create an expression without using a pre-aggregated table? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 05:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352735#M1175365</guid>
      <dc:creator />
      <dc:date>2012-04-17T05:12:11Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352736#M1175366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't get what your trying to say. Can you explain little bit briefly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 07:50:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352736#M1175366</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2012-04-17T07:50:59Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352737#M1175367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I updated the original description of the problem. I made a mistake by not including the Calendar table in the first version. Your load script creates a table that aggregates all values, but instead it should group the values by Year and Month. As far as I understand, I can't add a Year and Month attribute to the "Res_Main1" table you created. I would get two different Year and Month dimensions. In Calendar table, and in Res_Main1 table. The Calendar table is the master calendar for the document. When I select Year=2011 from Calendar it should show Billing % calculations for 2011, but it should also filter all other graphs by 2011. Therefore I can't add a GROUP BY Year and Month to Res_Main1. It would solve the problem in this simplistic example, but it would introduce duplicate Year and Month dimensions in the real world application. Sorry for any confusion I have created by changing the original description of the problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 10:42:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352737#M1175367</guid>
      <dc:creator />
      <dc:date>2012-04-17T10:42:47Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352738#M1175368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have two tables i.e, Calender and Work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both tables you have a common field Date. It makes the link between two tables. When you select year 2011 from calender definetly it will effect the other charts also. What is the issue then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if i'm not clear. Otherwise show me application with sample data. What is the output you want from that data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 11:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352738#M1175368</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2012-04-17T11:29:54Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352739#M1175369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot, you have helped me to find the solution. I interpreted your solution that I need to create a third table, called Res_Main1. The association between that table and Work table was not clear to me. Finally, I understood that I had to use a set expression in order to get the calculations correct. Here's the code I ended up with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Employee ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempBilling, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BillingRangeYear ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BillingRangeMonth ,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling &amp;lt; 0.3, 1, 0) AS BillingRange0_30,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=0.3 and TempBilling &amp;lt; 0.5, 1, 0) AS BillingRange30_50,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=0.5 and TempBilling &amp;lt; 0.7, 1, 0) AS BillingRange50_70,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=0.7 and TempBilling &amp;lt; 0.8, 1, 0) AS BillingRange70_80,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=0.8 and TempBilling &amp;lt; 0.9, 1, 0) AS BillingRange80_90,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(TempBilling&amp;gt;=0.9 , 1, 0) AS BillingRange90_100;&lt;/P&gt;&lt;P&gt;LOAD [Employee ID],Sum ([Billable Hours])/Sum ([Total Hours]) as TempBilling,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year([Date]) as BillingRangeYear,&amp;nbsp;&amp;nbsp;&amp;nbsp; Month([Date]) as BillingRangeMonth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident Work&lt;/P&gt;&lt;P&gt;Group By [Employee ID], Year([Date]), Month([Date]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following expression to get the year filter to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[BillingRangeYear] ={$(=GetFieldSelections([Year]))}&amp;gt;} BillingRange90_100)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 12:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352739#M1175369</guid>
      <dc:creator />
      <dc:date>2012-04-17T12:58:36Z</dc:date>
    </item>
    <item>
      <title>Need help to create aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352740#M1175370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's well buddy..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 13:10:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-to-create-aggregation/m-p/352740#M1175370</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2012-04-17T13:10:17Z</dc:date>
    </item>
  </channel>
</rss>

