<?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: Pivot Table Last month Sales in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237613#M393449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will break this expression to help you understand the expression.... This is actually the easiest it can get....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part 1A -&amp;gt; &lt;STRONG&gt;Above(Sum(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;CalendarYear&amp;gt;}&lt;/SPAN&gt;Sales))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Part 1B -&amp;gt; &lt;STRONG&gt;Above(Sum(Sales))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference between Part1A and Part1B is that Part1A excludes any selection in CalendarYear. Why I think of adding that? Because you had a selection in Year field. If you plan to make selection in YYYYMMID, then I would say add that to your set analysis to so that we can ignore any selection in that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146263_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the image above I see Jan-2016 value for Part1A because I have ignore selection in CalendarYear whereas I don't see in Part 1B. Now because we have ignore selection in CalendarYear, we will start to see all CalendarYear. To combat this problem, we introduce multiplication with Avg(1). Avg(1) will equal to 1 within selection and will equal 0 outside of selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/146267_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I multiple the two and bang I get what I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense?&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>Sat, 10 Dec 2016 02:15:11 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-10T02:15:11Z</dc:date>
    <item>
      <title>Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237610#M393446</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;I have a pivot table with Month (field MONTH-Yr) as Dimension, and Sales as Expression.&lt;/P&gt;&lt;P&gt;I want to show the previous month sales as a new Expression. Also the month for January should be populated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I have YYYYMMID filed which is an integer autonumber based on field YYYYMM which I think could facilitate the problem.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample app is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate all the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 15:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237610#M393446</guid>
      <dc:creator />
      <dc:date>2016-12-09T15:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237611#M393447</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;Above(Sum({&amp;lt;CalendarYear&amp;gt;}Sales)) * Avg(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 16:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237611#M393447</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-09T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237612#M393448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny, Seems to give the correct result, but can you explain the expression? I find it hard to get why such a simple and common requirement ends up in quite a complex expression &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Do you know how to utilize field YYYYMMID to solve this kind of problem as that would make it more readable? I tried something on the following lines: =sum({&amp;lt; YYYYMMID={$(=YYYYMMID -1)} &amp;gt;}&amp;nbsp; Sales) but didn't manage to get it to work. Thanks, Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 18:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237612#M393448</guid>
      <dc:creator />
      <dc:date>2016-12-09T18:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237613#M393449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will break this expression to help you understand the expression.... This is actually the easiest it can get....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part 1A -&amp;gt; &lt;STRONG&gt;Above(Sum(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;CalendarYear&amp;gt;}&lt;/SPAN&gt;Sales))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Part 1B -&amp;gt; &lt;STRONG&gt;Above(Sum(Sales))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference between Part1A and Part1B is that Part1A excludes any selection in CalendarYear. Why I think of adding that? Because you had a selection in Year field. If you plan to make selection in YYYYMMID, then I would say add that to your set analysis to so that we can ignore any selection in that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/146263_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the image above I see Jan-2016 value for Part1A because I have ignore selection in CalendarYear whereas I don't see in Part 1B. Now because we have ignore selection in CalendarYear, we will start to see all CalendarYear. To combat this problem, we introduce multiplication with Avg(1). Avg(1) will equal to 1 within selection and will equal 0 outside of selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/146267_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I multiple the two and bang I get what I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense?&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>Sat, 10 Dec 2016 02:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237613#M393449</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-10T02:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237614#M393450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny I appreciate your help and the time to provide the explanation. It is straightforward but never knew of such techniques to use Avg(1). Just wanted to reconfirm that there is no way of using YYYYMMID as in sum({&amp;lt; YYYYMMID={$(=YYYYMMID -1)} &amp;gt;}&amp;nbsp; Sales) in pivot tables, snice it should work fine in other types of charts correct? Good day, Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Dec 2016 09:00:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237614#M393450</guid>
      <dc:creator />
      <dc:date>2016-12-10T09:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237615#M393451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are dimension is a time dimension, the set analysis won't work because set analysis is evaluated once per chart. So, basically YYYYMMID-1 will have to output only one value and that will happen only when you have selected one MonthYear or you can use Max(YYYYMMID) - 1 but then you will see only a single previous month in your chart and that is not what you want. So in this case the only way to get this work is to use Above function.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Since it should work fine in other types of charts correct? Good day, Jon&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What other charts do you imagine this would work in? in it's current form, it will only work if you have one YYYYMMID selected. and what if you have selected a particular YYYYMMID (say 158), it will show you the sum for 157.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Dec 2016 11:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237615#M393451</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-10T11:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237616#M393452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you're right charts wont work when using that kind of logic.&lt;/P&gt;&lt;P&gt;Thanks for your help, will mark your answer as Correct &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Dec 2016 12:07:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237616#M393452</guid>
      <dc:creator />
      <dc:date>2016-12-10T12:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237617#M393453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can this be done over multiple Years with a Month-Year dimension and say a State dimension?&amp;nbsp; Also is there an expression like this that can work in a Table to be used in a ClimberCustomReport?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237617#M393453</guid>
      <dc:creator>kinahan7</dc:creator>
      <dc:date>2018-04-06T13:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237618#M393454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Can this be done over multiple Years with a Month-Year dimension and say a State dimension?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It can... will need modification if you need full accumulation vs accumulation for each state&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Also is there an expression like this that can work in a Table to be used in a ClimberCustomReport?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not sure what ClimberCustomReport is&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237618#M393454</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-06T15:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237619#M393455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking for accumulation for each state, or other dimensions.&amp;nbsp; Ideally I would want the ability to bring in multiple dimensions and have the measure still work.&amp;nbsp; If you had a custom pivot with the ability to bring in State, County, City and Zip - Or any combination of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ClimberCustomReport is a Qlik Sense extension that makes building a custom report simple.&amp;nbsp; The report works like an Excel pivot table by being able to choose dimensions and measures.&amp;nbsp; This extension works by using a regular table with all possible fields.&amp;nbsp; So can an expression calculate like below with the ability to bring in State, County City or Zip to see "Sales" by any dimension?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This type of view-&lt;/P&gt;&lt;P&gt;&lt;IMG alt="04-06-2018 12-28-16 PM.jpg" class="jive-image image-1" src="/legacyfs/online/198774_04-06-2018 12-28-16 PM.jpg" style="height: 126px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Then bring in State, County, City or Zip&lt;/P&gt;&lt;P&gt;&lt;IMG alt="04-06-2018 12-31-11 PM.jpg" class="jive-image image-2" src="/legacyfs/online/198775_04-06-2018 12-31-11 PM.jpg" style="height: 320px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237619#M393455</guid>
      <dc:creator>kinahan7</dc:creator>
      <dc:date>2018-04-06T16:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot Table Last month Sales</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237620#M393456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest looking into &lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt; for the best solution for your scenario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 17:23:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Last-month-Sales/m-p/1237620#M393456</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-06T17:23:15Z</dc:date>
    </item>
  </channel>
</rss>

