<?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: Nested Aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257528#M518852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum({&amp;lt;DT_CONS_DIM.FISC_PER_CD = {"$(=Max({&amp;lt;PRC_USD_AMT = {'*'}&amp;gt;}DT_CONS_DIM.FISC_PER_CD))"}&amp;gt;}Aggr(FirstSortedValue(Aggr(Sum(PRC_USD_AMT),INVC__DT,CTRY_NAM),-Aggr(FISC_DAY_OF_MTH_NBR, INVC__DT,CTRY_NAM)), DT_CONS_DIM.FISC_PER_CD, CTRY_NAM))/1000000,'#,###,##0.00 M')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2016 14:43:08 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-07T14:43:08Z</dc:date>
    <item>
      <title>Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257519#M518839</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;I am trying to achieve the below to fit into a single textbox, please give me your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 350px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Fiscal Period&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Country&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;=Num(FirstSortedValue( Aggr(Sum(PRC_USD_AMT),SLS_RPT_TRNS.INVC__DT,CTRY_NAM),-Aggr(DT_CONS_DIM.FISC_DAY_OF_MTH_NBR,SLS_RPT_TRNS.INVC__DT,CTRY_NAM))/1000000,'#,###,##0.00 M')&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="192"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt;201610&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt;Mexico&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;3.45 M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt;201610&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt;Germany&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;11.96 M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt;201610&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt;India&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;13.27 M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt;201610&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt;US&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;33.92 M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="94"&gt; &lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;" width="64"&gt;&lt;STRONG&gt;Sum&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none; color: #575757; text-align: left; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;STRONG&gt;64.86 M&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the Sum to be displayed in a text box. It is the Sum of Sales for the most recent date for each country.&lt;/P&gt;&lt;P&gt;please let me know if more information is needed.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257519#M518839</guid>
      <dc:creator />
      <dc:date>2016-11-30T14:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257520#M518840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;=Num(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;Sum(Aggr(&lt;/SPAN&gt;FirstSortedValue(Aggr(Sum(PRC_USD_AMT),SLS_RPT_TRNS.INVC__DT,CTRY_NAM),-Aggr(DT_CONS_DIM.FISC_DAY_OF_MTH_NBR,SLS_RPT_TRNS.INVC__DT,CTRY_NAM))/1000000&lt;SPAN style="color: #ff0000;"&gt;,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;[Fiscal Period], Country))&lt;/SPAN&gt;,'#,###,##0.00 M')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:37:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257520#M518840</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-30T14:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257521#M518841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Sunny.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above table is just for explaining the requirement, so the expression cannot be used with Fiscal Period. So i tried to replace it with the INVC__DT and it does not give me the right value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every country will have multiple entries for dates, and i will have to pick only the most recent value for every country and show the Sum in a text box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257521#M518841</guid>
      <dc:creator />
      <dc:date>2016-11-30T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257522#M518842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why can we not use Fiscal Period? I am not sure I understand that part&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:54:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257522#M518842</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-30T14:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257523#M518843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried with Fiscal Period as well, it does not give me the required value of 64.86.. I will try to upload a sample document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257523#M518843</guid>
      <dc:creator />
      <dc:date>2016-11-30T14:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257524#M518844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 15:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257524#M518844</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-30T15:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257525#M518846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached a sample here. I would like to get the Sum of Sales for all the countries for their most recent dates and display in a text box.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 13:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257525#M518846</guid>
      <dc:creator />
      <dc:date>2016-12-07T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257526#M518848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum(Aggr(FirstSortedValue(Aggr(Sum(PRC_USD_AMT),INVC__DT,CTRY_NAM),-Aggr(FISC_DAY_OF_MTH_NBR, INVC__DT,CTRY_NAM)), DT_CONS_DIM.FISC_PER_CD, CTRY_NAM, INVC__DT))/1000000,'#,###,##0.00 M')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/145901_Capture.PNG" style="height: 256px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 14:03:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257526#M518848</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-07T14:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257527#M518850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Daily Sales.JPG" class="jive-image image-1" src="/legacyfs/online/145900_Daily Sales.JPG" style="height: 281px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Expected value is 65.66 M which i get if i make a selection on the INVC__DT column, but i need this value without any selection.&lt;/P&gt;&lt;P&gt;Most recent values for India is on 18th, Germany on 17th, US on 17th and Mexico on 17th.. Which totals to 65.66 M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 14:33:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257527#M518850</guid>
      <dc:creator />
      <dc:date>2016-12-07T14:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257528#M518852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum({&amp;lt;DT_CONS_DIM.FISC_PER_CD = {"$(=Max({&amp;lt;PRC_USD_AMT = {'*'}&amp;gt;}DT_CONS_DIM.FISC_PER_CD))"}&amp;gt;}Aggr(FirstSortedValue(Aggr(Sum(PRC_USD_AMT),INVC__DT,CTRY_NAM),-Aggr(FISC_DAY_OF_MTH_NBR, INVC__DT,CTRY_NAM)), DT_CONS_DIM.FISC_PER_CD, CTRY_NAM))/1000000,'#,###,##0.00 M')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 14:43:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257528#M518852</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-07T14:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257529#M518853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to work for me. Thanks Sunny.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 09:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Aggregation/m-p/1257529#M518853</guid>
      <dc:creator />
      <dc:date>2016-12-09T09:49:05Z</dc:date>
    </item>
  </channel>
</rss>

