<?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: Total Sales in previous month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622353#M478938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pawel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have personal Edition, so I cannot open your application. But :&lt;/P&gt;&lt;P&gt;1) Set Analysis : they are computed ONCE per chart, not once per row (here, if you want to use set analysis, you would need different results across the lines =&amp;gt; it is not good)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You can use functions like &lt;STRONG&gt;above&lt;/STRONG&gt;() that will return the N lines above. The problem is for the 1st line where it returns 0.&lt;/P&gt;&lt;P&gt;If the months are across (in column), you will use &lt;STRONG&gt;Before&lt;/STRONG&gt;() function instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) You can also modify the model so that you create intermediate tables (called AsofTable) to simplify YTD, Previous period etc.&lt;/P&gt;&lt;P&gt;See a doc I have written on that topic: &lt;A href="http://community.qlik.com/docs/DOC-4821"&gt;http://community.qlik.com/docs/DOC-4821&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2014 09:50:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-24T09:50:08Z</dc:date>
    <item>
      <title>Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622352#M478937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to make a pivot table with total sums of sales in &lt;SPAN style="text-decoration: underline;"&gt;previous&lt;/SPAN&gt; month; the goal is to get something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp;&amp;nbsp;&amp;nbsp; Month_Name&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales in Previous Month&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales in This Month&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp; October&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00&amp;nbsp;&amp;nbsp;&amp;nbsp; 669,425.25&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp; November&amp;nbsp;&amp;nbsp;&amp;nbsp; 669,425.25&amp;nbsp;&amp;nbsp;&amp;nbsp; 632,081.48&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp; December&amp;nbsp;&amp;nbsp;&amp;nbsp; 632,081.48&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,050,705.58&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried a solution found on iQlik (please see my attachment) but it doesn't work. Can anybody fix it and / or explain?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Pawel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 09:33:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622352#M478937</guid>
      <dc:creator />
      <dc:date>2014-02-24T09:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622353#M478938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pawel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have personal Edition, so I cannot open your application. But :&lt;/P&gt;&lt;P&gt;1) Set Analysis : they are computed ONCE per chart, not once per row (here, if you want to use set analysis, you would need different results across the lines =&amp;gt; it is not good)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You can use functions like &lt;STRONG&gt;above&lt;/STRONG&gt;() that will return the N lines above. The problem is for the 1st line where it returns 0.&lt;/P&gt;&lt;P&gt;If the months are across (in column), you will use &lt;STRONG&gt;Before&lt;/STRONG&gt;() function instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) You can also modify the model so that you create intermediate tables (called AsofTable) to simplify YTD, Previous period etc.&lt;/P&gt;&lt;P&gt;See a doc I have written on that topic: &lt;A href="http://community.qlik.com/docs/DOC-4821"&gt;http://community.qlik.com/docs/DOC-4821&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 09:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622353#M478938</guid>
      <dc:creator />
      <dc:date>2014-02-24T09:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622354#M478939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Pawel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Kindly handle this one in Script level using Peek function.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 09:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622354#M478939</guid>
      <dc:creator>pandiarajan</dc:creator>
      <dc:date>2014-02-24T09:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622355#M478940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Pavel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can be possible by above function. Please go through the attached QVW . Hope it solve your query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 10:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622355#M478940</guid>
      <dc:creator>ashwanin</dc:creator>
      <dc:date>2014-02-24T10:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622356#M478941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; find the attachment. i hope it will solve ur problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 10:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622356#M478941</guid>
      <dc:creator>pandiarajan</dc:creator>
      <dc:date>2014-02-24T10:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622357#M478942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Ashwani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help but I can't use the above function as client could select only one month - that would give only one line in a pivot. The &lt;STRONG&gt;above&lt;/STRONG&gt;() function will be my last resort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind reagrds,&lt;BR /&gt;Paweł&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 10:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622357#M478942</guid>
      <dc:creator />
      <dc:date>2014-02-24T10:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622358#M478943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is the problem of the &lt;STRONG&gt;above&lt;/STRONG&gt; function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you will need to update your model either by creating a new field populated with the &lt;STRONG&gt;peek&lt;/STRONG&gt;() function in the script, or by creating an AsOfTable (if you want to do more than just returning the previous month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 10:47:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622358#M478943</guid>
      <dc:creator />
      <dc:date>2014-02-24T10:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622359#M478944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;user this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesDataTemp:&lt;/P&gt;&lt;P&gt;LOAD SalesDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qty, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(SalesDate,'MMM-YY') as SalesMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(SalesDate,'YYYYMM') as MonthNo&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\admin\Desktop\Sales.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesData:&lt;/P&gt;&lt;P&gt;LOAD RowNo() as No,&lt;/P&gt;&lt;P&gt;CustomerName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SalesMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qty as CurrentMonthQty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value as CurrentMonthValue,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(RowNo() =1 ,0 ,Previous(Qty)) as PreviousMonthQty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(RowNo()=1,0,Previous(Value)) as PreviousMonthValue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident SalesDataTemp order by MonthNo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop table SalesDataTemp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 10:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622359#M478944</guid>
      <dc:creator>pandiarajan</dc:creator>
      <dc:date>2014-02-24T10:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622360#M478945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Fabrice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your comments. For the time being, the only solution that I can use here is adding the month numbers to calendar (Oct 2013 would be 1, Oct 2014 would be 13 etc.) but I'm interested in any other ways to achieve that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Pawel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 11:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622360#M478945</guid>
      <dc:creator />
      <dc:date>2014-02-24T11:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622361#M478946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;...but it doesn't help, either. My expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;MonthNumber = {$(=Max(MonthNumber) – 1)}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why it gives zeroes every time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 11:30:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622361#M478946</guid>
      <dc:creator />
      <dc:date>2014-02-24T11:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622362#M478947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pawel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done this . u can check the qvw file in which both current month and previous month wise sales is working .&lt;/P&gt;&lt;P&gt;If u select the year then it will show the current month and previous month sales of selected year according to the product code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 11:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622362#M478947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-24T11:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622363#M478948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dhiraj,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you very much and I really appreciate your help. It don't seem to work when I add month name to dimensions - can you tell me why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 12:19:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622363#M478948</guid>
      <dc:creator />
      <dc:date>2014-02-24T12:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Total Sales in previous month</title>
      <link>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622364#M478949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pawel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The month_name would be work as dimention when u will use the bar chart. Bcz when u will pass the month_name as a dimension in pivot table then it will show only that month sales which is in dimension .&lt;/P&gt;&lt;P&gt;According to that month which is in dimension the sales would be appear if we will calculate the previous month then it will show the zero bcz it will not get the dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 12:36:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-Sales-in-previous-month/m-p/622364#M478949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-24T12:36:00Z</dc:date>
    </item>
  </channel>
</rss>

