<?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: How to get Top 3 Brands for MAT Calculation with Two Dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands-for-MAT-Calculation-with-Two-Dimension/m-p/1304318#M406133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved the solution using this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(((FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand = {"=Rank(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {'$(=Max(AsOfYear))'}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))) &amp;lt;= 3"},&lt;/P&gt;&lt;P&gt;PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand)))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand = {"=Rank(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {'$(=Max(AsOfYear))'}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))) &amp;lt;= 3"},&lt;/P&gt;&lt;P&gt;PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;((Sum({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL &amp;lt;AsOfYear&amp;gt;Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand)))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL &amp;lt;AsOfYear&amp;gt;Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand)))))*100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Mar 2017 09:14:40 GMT</pubDate>
    <dc:creator>hemanthaanichet</dc:creator>
    <dc:date>2017-03-31T09:14:40Z</dc:date>
    <item>
      <title>How to get Top 3 Brands for MAT Calculation with Two Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands-for-MAT-Calculation-with-Two-Dimension/m-p/1304317#M406132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I need to calculate MAT for the available data and has to show Top 3 brands for the selected period&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit; text-decoration: underline;"&gt;Moving Average Turnover (MAT):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Dimensions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;1. Year&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;2. Brand&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Formula:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;(Current Year MAT Sale&amp;nbsp; - Previous Year&amp;nbsp; MAT Sale)&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;/&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;(Current Year MAT Total Sale - Previous Year&amp;nbsp; MAT&amp;nbsp; Total Sale)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Current Year&lt;/STRONG&gt; : latest 12 months i.e.,&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;(Aug-15 to Jul-16)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Previous Year&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; : previous latest 12 months i.e.,&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;(Aug-14 to Jul-15)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Expression &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;output value&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px;"&gt;should&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; be plotted in latest year i.e.,&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; 2016&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;The above MAT solved with the below expression:&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;((FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand)))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;(Sum(TOTAL&amp;lt;AsOfPeriod&amp;gt; Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Sum(TOTAL&amp;lt;AsOfPeriod&amp;gt; Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand))))*100&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;When I need to get the Top 3 Brands, Output values are not correct &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;when selected period has more than 3 brands. if the selected period has&amp;nbsp; 3 brands the values are&amp;nbsp; correct&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Attached the Sample Data&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 16:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands-for-MAT-Calculation-with-Two-Dimension/m-p/1304317#M406132</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-29T16:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands for MAT Calculation with Two Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands-for-MAT-Calculation-with-Two-Dimension/m-p/1304318#M406133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved the solution using this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(((FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand = {"=Rank(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {'$(=Max(AsOfYear))'}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))) &amp;lt;= 3"},&lt;/P&gt;&lt;P&gt;PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand)))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand = {"=Rank(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {'$(=Max(AsOfYear))'}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))) &amp;lt;= 3"},&lt;/P&gt;&lt;P&gt;PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand))))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;((Sum({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL &amp;lt;AsOfYear&amp;gt;Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'CYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand)))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;TOTAL &amp;lt;AsOfYear&amp;gt;Aggr(FirstSortedValue({&amp;lt;AsOfMonthNr = {$(=Max({&amp;lt;AsOfYear = {$(=Max(AsOfYear))}&amp;gt;}AsOfMonthNr))},&lt;/P&gt;&lt;P&gt;Brand , PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear = {"$(='&amp;lt;=' &amp;amp; Max(AsOfYear))"}, AsOfMonth&amp;gt;}&lt;/P&gt;&lt;P&gt;Aggr(Sum({&amp;lt;Brand, PeriodType = {'PYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales), AsOfPeriod, Brand, AsOfYear),&lt;/P&gt;&lt;P&gt;-Aggr(Only({&amp;lt;Brand=, PeriodType = {'PYMONTH'},&amp;nbsp; AsOfYear, AsOfMonth&amp;gt;}AsOfPeriod), AsOfPeriod, Brand, AsOfYear)), AsOfYear, Brand)))))*100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 09:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands-for-MAT-Calculation-with-Two-Dimension/m-p/1304318#M406133</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-31T09:14:40Z</dc:date>
    </item>
  </channel>
</rss>

