<?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: BEST MONTH OF LAST 12 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704882#M254176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK... I will give you another example based on that you can work out ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider you have Sales data for different customers over a period of times. Let's say we have below fields..&lt;BR /&gt;Customer, Sales, InvoiceDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our objective is to find out Month having Maximum Sales over Last 12 Months period...&lt;/P&gt;&lt;P&gt;Kindly follow below steps&lt;/P&gt;&lt;P&gt;1) either create a master calendar or create below field in you sales table&lt;/P&gt;&lt;P&gt;Date(MonthStart(InvoiceDate),'YYYYMM') as MonthYear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Now create a straight table...&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expressions&lt;/P&gt;&lt;P&gt;=Max(Aggr(SUM({&amp;lt;MonthYear = {"&amp;gt;=$(=Date(MonthStart(Today(),-11),'YYYYMM'))"}&amp;gt;}Sales),MonthYear))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(FirstSortedValue(MonthYear,-Aggr(SUM({&amp;lt;MonthYear = {"&amp;gt;=$(=Date(MonthStart(Today(),-11),'YYYYMM'))"}&amp;gt;}Sales),MonthYear)),'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if it is still not working for you..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Oct 2014 09:57:40 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-10-11T09:57:40Z</dc:date>
    <item>
      <title>BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704879#M254173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Unable to resolve this problem. &lt;/P&gt;&lt;P&gt;I need to know which is the best month of the last 12 in sales, I choose Year or Month according suits me. Example format: &lt;/P&gt;&lt;P&gt;Choose selection boxes:&lt;/P&gt;&lt;P&gt; Year -&amp;gt; 2014&amp;nbsp;&amp;nbsp; Month -&amp;gt; September &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pivot Table:&lt;/P&gt;&lt;P&gt;Product | Sales This Month | Top Month | &lt;/P&gt;&lt;P&gt;Product A&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; 50000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; August 2014 &lt;/P&gt;&lt;P&gt;Product B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; February 2014 &lt;/P&gt;&lt;P&gt;Product C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 150000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; December 2014 &lt;/P&gt;&lt;P&gt;Product D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; July 2014 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 22:57:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704879#M254173</guid>
      <dc:creator>sorrakis01</dc:creator>
      <dc:date>2014-10-10T22:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704880#M254174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide some more information about your requirements... i.e. few lines of sample data and little more clarification on your requirements...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 07:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704880#M254174</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-10-11T07:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704881#M254175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have more than 50 sellers with sales every day. I need to Know what's the best month of the last 12 months, in only one expression in the same table for each one.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't upload the document for the sensitive data, but i upload a picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;IMG alt="Example 12 months.jpg" class="jive-image" src="/legacyfs/online/68715_Example 12 months.jpg" style="width: 620px; height: 461px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 09:17:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704881#M254175</guid>
      <dc:creator>sorrakis01</dc:creator>
      <dc:date>2014-10-11T09:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704882#M254176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK... I will give you another example based on that you can work out ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider you have Sales data for different customers over a period of times. Let's say we have below fields..&lt;BR /&gt;Customer, Sales, InvoiceDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our objective is to find out Month having Maximum Sales over Last 12 Months period...&lt;/P&gt;&lt;P&gt;Kindly follow below steps&lt;/P&gt;&lt;P&gt;1) either create a master calendar or create below field in you sales table&lt;/P&gt;&lt;P&gt;Date(MonthStart(InvoiceDate),'YYYYMM') as MonthYear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Now create a straight table...&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expressions&lt;/P&gt;&lt;P&gt;=Max(Aggr(SUM({&amp;lt;MonthYear = {"&amp;gt;=$(=Date(MonthStart(Today(),-11),'YYYYMM'))"}&amp;gt;}Sales),MonthYear))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(FirstSortedValue(MonthYear,-Aggr(SUM({&amp;lt;MonthYear = {"&amp;gt;=$(=Date(MonthStart(Today(),-11),'YYYYMM'))"}&amp;gt;}Sales),MonthYear)),'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if it is still not working for you..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 09:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704882#M254176</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-10-11T09:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704883#M254177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Malish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try this tonight or on Monday and I tell you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JAG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Oct 2014 15:37:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704883#M254177</guid>
      <dc:creator>sorrakis01</dc:creator>
      <dc:date>2014-10-11T15:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: BEST MONTH OF LAST 12</title>
      <link>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704884#M254178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firtsly thanks for your answer and your time, your example works but it's a problem. You use the date Today() and whats up If I need to use another date of the selection values. Ex: If I selected Year 2013, your example doesn't work, what do you think about it? it's possible other solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 11:31:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/BEST-MONTH-OF-LAST-12/m-p/704884#M254178</guid>
      <dc:creator>sorrakis01</dc:creator>
      <dc:date>2014-10-13T11:31:06Z</dc:date>
    </item>
  </channel>
</rss>

