<?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? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294734#M404318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its just flag brother...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Period type =CYMONTH then&amp;nbsp; Jan-16 will have Sum( sales) of latest 12 months&lt;/P&gt;&lt;P&gt;Period Type = Current&amp;nbsp; then Jan-16 will have Sum(Sales) of selected month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its woking fine brother..... Thanks alot brother.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Mar 2017 18:27:54 GMT</pubDate>
    <dc:creator>hemanthaanichet</dc:creator>
    <dc:date>2017-03-28T18:27:54Z</dc:date>
    <item>
      <title>How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294730#M404314</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;i need to get Top 3 Brands &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i used this expression in Dimension &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(aggr(rank(sum({&amp;lt;AsOfYear={'$(=max(AsOfYear))'}&amp;gt;}Sales)),Brand)&amp;lt;=3,Brand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum({&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"}, &lt;/P&gt;&lt;P&gt;PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;Sum(Total&amp;lt;AsOfPeriod&amp;gt;{&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"}, &lt;/P&gt;&lt;P&gt;PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth,Brand&amp;gt;}Sales))*100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above expression works fine, when selected period has only 3 brands. if the selected period has more than 3 brands the values are not correct &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example &lt;/P&gt;&lt;P&gt;Jan 2016 has only 3 brands whose share are A=45% ,B=35%, C=20% and the sum is equal to 100%&lt;/P&gt;&lt;P&gt;if suppose the same Jan -2016 has 5 brands whose share are A=35%, B=25%, C=20% ,D=15%, E=5% .&lt;/P&gt;&lt;P&gt;i need only top 3 brands&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt; A=35%, B=25%, C=20% and the sum should&amp;nbsp; be 80% but not 100%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached the sample data &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 17:52:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294730#M404314</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-28T17:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294731#M404315</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;(Sum({&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"}, Brand = {"=rank(sum({&amp;lt;AsOfYear={'$(=max(AsOfYear))'}&amp;gt;}Sales)) &amp;lt; 4"},&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Total&amp;lt;AsOfPeriod&amp;gt;{&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"}, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PeriodType = {'CYMONTH'}, AsOfYear, AsOfMonth,Brand&amp;gt;}Sales))*100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With &lt;STRONG&gt;Brand&lt;/STRONG&gt; as the dimension&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 17:57:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294731#M404315</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-28T17:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294732#M404316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brother,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Slight Change in the Expression&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;"&gt;(Sum({&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"}, Brand = {"=rank(sum({&amp;lt;AsOfYear={'$(=max(AsOfYear))'}&amp;gt;}Sales)) &amp;lt; 4"},&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-family: inherit;"&gt;PeriodType = {'&lt;SPAN style="color: #ff0000;"&gt;Current&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;}, AsOfYear, AsOfMonth&amp;gt;}Sales)&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-family: inherit;"&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-family: inherit;"&gt;Sum(Total&amp;lt;AsOfPeriod&amp;gt;{&amp;lt;AsOfPeriod ={"$(='&amp;gt;=' &amp;amp; Date(AddMonths(Max(AsOfPeriod), -11), 'MMM-YY') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(AsOfPeriod), 'MMM-YY'))"},&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-family: inherit;"&gt;PeriodType = {'&lt;STRONG style="color: #ff0000; font-style: inherit; font-family: inherit;"&gt;Current&lt;/STRONG&gt;'}, AsOfYear, AsOfMonth,Brand&amp;gt;}Sales))*100&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-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-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;But it working fine i think let me go a check bro....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:13:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294732#M404316</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-28T18:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294733#M404317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just modified your current expression brother.... I don't know what the difference is between Current and CYMONTH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294733#M404317</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-28T18:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294734#M404318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its just flag brother...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Period type =CYMONTH then&amp;nbsp; Jan-16 will have Sum( sales) of latest 12 months&lt;/P&gt;&lt;P&gt;Period Type = Current&amp;nbsp; then Jan-16 will have Sum(Sales) of selected month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its woking fine brother..... Thanks alot brother.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:27:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294734#M404318</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-28T18:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294735#M404319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome... close the thread in that case....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294735#M404319</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-28T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294736#M404320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah sure brother once I implemented it in the original app I will surely close the thread brother...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies for previous not closed thread...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294736#M404320</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2017-03-28T18:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Top 3 Brands?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294737#M404321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem at all &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:58:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-Top-3-Brands/m-p/1294737#M404321</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-28T18:58:08Z</dc:date>
    </item>
  </channel>
</rss>

