<?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: Need help with the Aggr function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754357#M533937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Month = {'$(=Max({&amp;lt;Year = {'$(=Max(Year))'}&amp;gt;}Month))'},ActiveEmployeeYN = {'1'}&amp;gt;}[Annual Salary])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2015 21:13:14 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2015-02-19T21:13:14Z</dc:date>
    <item>
      <title>Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754353#M533933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue trying to get a formula I put in a textbox to match up to a sum of rows in a chart.&amp;nbsp; As you can see from the image below, my sum of rows is $13,705,160.52.&lt;/P&gt;&lt;P&gt;Here is the formula I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(Year= $(=Max(Year)) and num(Month)= $(=Max(Month)) and ActiveEmployeeYN = 1 ,[Annual Salary])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the green textbox above, I'm using the exact same formula but add sum and formatting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=num(sum(if(Year= $(=Max(Year)) and num(Month)= $(=Max(Month)) and ActiveEmployeeYN = 1 , [Annual Salary])),'$#,##0.##')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Analytics.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78553_Analytics.jpg" style="height: 464px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me what I'm doing wrong?&amp;nbsp; I believe I need to use the Aggr function, but anytime I use it, my value is 0.&amp;nbsp; Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 14:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754353#M533933</guid>
      <dc:creator />
      <dc:date>2015-02-19T14:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754354#M533934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide 5-10 lines of sample data please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 20:48:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754354#M533934</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-19T20:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754355#M533935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I understand what you want.&amp;nbsp; The chart on the bottom right is what I'm using for the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 20:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754355#M533935</guid>
      <dc:creator />
      <dc:date>2015-02-19T20:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754356#M533936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a spreadsheet that includes the data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 20:58:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754356#M533936</guid>
      <dc:creator />
      <dc:date>2015-02-19T20:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754357#M533937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Month = {'$(=Max({&amp;lt;Year = {'$(=Max(Year))'}&amp;gt;}Month))'},ActiveEmployeeYN = {'1'}&amp;gt;}[Annual Salary])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 21:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754357#M533937</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-19T21:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754358#M533938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's showing an error in the expression window, and showing a 0 value in the text box.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78603_error.jpg" style="height: 83px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 21:46:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754358#M533938</guid>
      <dc:creator />
      <dc:date>2015-02-19T21:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754359#M533939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create an Inline Table as below&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Month, MonthNo&lt;/P&gt;&lt;P&gt;Jan, 1&lt;/P&gt;&lt;P&gt;Feb, 2&lt;/P&gt;&lt;P&gt;Mar, 3&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upto Dec 12 and use MonthNo instead of Month...&lt;/P&gt;&lt;P&gt;Let me know if still not working for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 23:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754359#M533939</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-19T23:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754360#M533940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same issue,&amp;nbsp; MonthNo is still underlined in red&lt;IMG alt="script.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78849_script.jpg" style="height: 62px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:11:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754360#M533940</guid>
      <dc:creator />
      <dc:date>2015-02-23T14:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754361#M533941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=Month = {"$(=Max({&amp;lt;Year = {'$(=Max(Year))'}&amp;gt;}MonthNo))"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:33:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754361#M533941</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T14:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754362#M533942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still get an error.&amp;nbsp; I've attached the qvw.&amp;nbsp; I hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754362#M533942</guid>
      <dc:creator />
      <dc:date>2015-02-23T14:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754363#M533943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After adding Month, MonthNo table, have you reload the data... I can't see any join between Master_Calender Month and Month/MonthNo table...&lt;/P&gt;&lt;P&gt;Please check...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754363#M533943</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754364#M533944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did reload the data, and if you look at the Table Viewer, you can see the connection. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 14:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754364#M533944</guid>
      <dc:creator />
      <dc:date>2015-02-23T14:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754365#M533945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Remove that table and try to add below line while loading master calendar..&lt;/P&gt;&lt;P&gt;=SubField('$(MonthNames)',';',Max({&amp;lt;Year = {'$(=Max(Year))'}&amp;gt;}Month)) as MonthNo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check again whether it is working or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 15:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754365#M533945</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754366#M533946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem lies in your Master Calendar... Let me know how you have created master calendar... Can you provide the script you have used... Also how is the format of your WorkDate?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 15:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754366#M533946</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754367#M533947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WorkDate is MDYY format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code used for Master Calendar:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14247079772516364 jive_text_macro jive_macro_code" jivemacro_uid="_14247079772516364" modifiedtitle="true"&gt;
&lt;P&gt;/* Temporary MinMax Table */&lt;BR /&gt;min_max:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(MIN(WorkDate)) AS MinDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; today() AS MaxDate&lt;BR /&gt;RESIDENT Fact_Employee;&lt;BR /&gt;&lt;BR /&gt;LET vMinDate = NUM(PEEK('MinDate', 0, 'MinMax'));&lt;BR /&gt;LET vMaxDate = NUM(PEEK('MaxDate', 0, 'MinMax'));&lt;BR /&gt;LET vToday = $(vMaxDate);&lt;BR /&gt;LET vCurrentDate = NUM(TODAY());&lt;BR /&gt;LET vCurrentDateTime = NUM(NOW());&lt;BR /&gt;&lt;BR /&gt;/* Temporary Calendar */&lt;BR /&gt;temp_cal:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE($(vMinDate) + ROWNO() - 1) AS TempDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOGENERATE $(vMaxDate) - $(vMinDate) + 1;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE min_max;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/* Calendar */&lt;BR /&gt;MasterCalendar_temp:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; monthstart(TempDate) AS WorkDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR(TempDate) AS Year,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MONTH(TempDate) AS Month,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Q' &amp;amp; CEIL(MONTH(TempDate)/3) AS Quarter,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR(TempDate)&amp;nbsp; &amp;amp; ' ' &amp;amp; CEIL(MONTH(TempDate)/3) as 'QuarterYear',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(MONTHSTART(TempDate),'MMM-YYYY') AS MonthYear,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INYEARTODATE(TempDate,$(vToday), 0) * -1 AS CurYTDFlag,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INYEARTODATE(TempDate,$(vToday), -1) * -1 AS LastYTDFlag&lt;BR /&gt;RESIDENT temp_cal&lt;BR /&gt;ORDER BY TempDate DESC;&lt;BR /&gt;&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load&lt;BR /&gt;*&lt;BR /&gt;RESIDENT MasterCalendar_temp&lt;BR /&gt;where &lt;BR /&gt;peek( WorkDate) &amp;lt;&amp;gt; WorkDate&lt;BR /&gt;order by WorkDate Desc;&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 16:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754367#M533947</guid>
      <dc:creator />
      <dc:date>2015-02-23T16:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754368#M533948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be wrong as 4400 will give you 4th April 1900... Correct me if I am wrong !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 16:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754368#M533948</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754369#M533949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I do a preview in the table viewer, it seems to be working properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mastercalendar.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78876_mastercalendar.jpg" style="height: 349px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 16:18:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754369#M533949</guid>
      <dc:creator />
      <dc:date>2015-02-23T16:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754370#M533950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check any date ending with 00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 16:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754370#M533950</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-23T16:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754371#M533951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mastercalendar.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/78877_mastercalendar.jpg" style="height: 349px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 16:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-the-Aggr-function/m-p/754371#M533951</guid>
      <dc:creator />
      <dc:date>2015-02-23T16:26:35Z</dc:date>
    </item>
  </channel>
</rss>

