<?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 Current Month and Previous Month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418015#M483885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to take current and previous month sales based on the selected month and year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Sales Month&amp;nbsp; looks like this 1,2,3,4,5,6,7,8,9,10,11,12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Sales Yerar looks like this 2011,2012,2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate current month sales i used this expression below (based on selected month),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;= &lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SALES_MONTH))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vSales)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;It works but when i try to calculate the previous month using the expression below, value is coming as "0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;= &lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SALES_MONTH)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vSales)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly guide where i'm wrong in this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Selva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 May 2013 07:26:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-29T07:26:37Z</dc:date>
    <item>
      <title>Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418015#M483885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to take current and previous month sales based on the selected month and year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Sales Month&amp;nbsp; looks like this 1,2,3,4,5,6,7,8,9,10,11,12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Sales Yerar looks like this 2011,2012,2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate current month sales i used this expression below (based on selected month),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;= &lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SALES_MONTH))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vSales)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;It works but when i try to calculate the previous month using the expression below, value is coming as "0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;= &lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"$(=max(SALES_MONTH)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vSales)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly guide where i'm wrong in this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Selva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 07:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418015#M483885</guid>
      <dc:creator />
      <dc:date>2013-05-29T07:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418016#M483886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for current--&lt;/P&gt;&lt;P&gt;sum({&amp;lt;SalesMonth={"$(=(SalesMonth))"},SalesYear={"$(=(SalesYear))"}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for previous--&lt;/P&gt;&lt;P&gt;sum({&amp;lt;SalesMonth={"$(=(SalesMonth)-1)"},SalesYear={"$(=(SalesYear))"}&amp;gt;}Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 07:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418016#M483886</guid>
      <dc:creator />
      <dc:date>2013-05-29T07:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418017#M483887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA. Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Som&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 08:12:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418017#M483887</guid>
      <dc:creator>somenathroy</dc:creator>
      <dc:date>2013-05-29T08:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418018#M483888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Som,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose my Sales month look like this ( Jan,Feb,Mar,Apr etc to Dec)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to calculate the previous year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Selva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 10:46:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418018#M483888</guid>
      <dc:creator />
      <dc:date>2013-05-29T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418019#M483889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Selva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expresion look fine. Can you tell me the definition of &lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vSales)?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 10:56:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418019#M483889</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2013-05-29T10:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418020#M483890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a numeric month field in the script: &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;num(month(date#(MonthName,'MMM'))) as MonthNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;You'll also need an incremental month field because the monthnum of Jan is 1 and the previous month is not 0, but 12 in the previous year. You can add a field like this: Year*12+&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;num(month(date#(MonthName,'MMM')))&lt;/SPAN&gt; as PeriodNumber. You can then use the PeriodNumber field in the set analysis expressions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Current: sum({&amp;lt;Sales_Year=,Sales_Month=,PeriodNumber={$(=max(PeriodNumber))&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; background-color: #ffffff; font-family: Arial;"&gt;Previous Month: sum({&amp;lt;Sales_Year=,Sales_Month=,PeriodNumber={$(=max(PeriodNumber)-1)&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; background-color: #ffffff; font-family: Arial;"&gt;Same Month previous year: &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;sum({&amp;lt;Sales_Year=,Sales_Month=,PeriodNumber={$(=max(PeriodNumber)-12)&amp;gt;} Sales)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 11:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418020#M483890</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-05-29T11:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418021#M483891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 12:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418021#M483891</guid>
      <dc:creator />
      <dc:date>2013-05-29T12:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Current Month and Previous Month</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418022#M483892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Selva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, still you can make a DATE using your table fields.&lt;/P&gt;&lt;P&gt;Like &lt;STRONG&gt;Date(Date#('2012-Jan-01','YYYY-MMM-DD'),'DD/MM/YYYY')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Som&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 06:46:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Month-and-Previous-Month/m-p/418022#M483892</guid>
      <dc:creator>somenathroy</dc:creator>
      <dc:date>2013-05-30T06:46:17Z</dc:date>
    </item>
  </channel>
</rss>

