<?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: Re: Re: Set Analysis - Previous Period % Change in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652914#M238672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A sample is attached.&amp;nbsp; Thank you in advance for taking a look at it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - I intentionally loaded two columns of "Periods".&amp;nbsp; One is text. The other, number.&amp;nbsp; That's how the original data is formatted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Sep 2014 12:38:54 GMT</pubDate>
    <dc:creator>jcampbell474</dc:creator>
    <dc:date>2014-09-23T12:38:54Z</dc:date>
    <item>
      <title>Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652906#M238664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to calculate the % difference in volume compared to the previous period.&amp;nbsp; I can compare to the previous year without issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the syntax I'm using to get % difference to the same period, previous year:&lt;/P&gt;&lt;P&gt;=if(isnull([Period]),'-',(sum([Quantity])-Sum ({$&amp;lt;FiscalYear = {$(=Max (FiscalYear)-1)} &amp;gt;} [Quantity]))/Sum ({$&amp;lt;FiscalYear = {$(=Max (FiscalYear)-1)} &amp;gt;} [Quantity]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I change "FiscalYear" to "Period", nothing calculates.&amp;nbsp; Every example I can find online uses date formatting...I'm using Periods 1-13.&amp;nbsp; So, no date formatting is needed.&amp;nbsp; I just need to be able to select period 7 and it show the % change from period 6 to period 7.&amp;nbsp; If I just select the year, 2014 for example, I need it to show the % change in each period to the prior.&amp;nbsp; At this point, comparing period 1 to period 13 of the previous fiscal year is ideal, but not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me how to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 17:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652906#M238664</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2014-09-19T17:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652907#M238665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the expression your wrote up there seems to work fine. Can you send a sample of what you are working on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 17:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652907#M238665</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-09-19T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652908#M238666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I don't think I can slice up the app successfully enough to post a copy of this example.&amp;nbsp; I appreciate you testing my formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why would the formula work using year, but not period?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 17:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652908#M238666</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2014-09-19T17:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652909#M238667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you looked at the qvw file I attached? It uses the formula with the period only and it seems to work just right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 18:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652909#M238667</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2014-09-19T18:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652910#M238668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I looked at it.&amp;nbsp; It does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I replace FiscalYear with Period in my file and goes to zero (0).&amp;nbsp; I removed everything and tried to get it to just calculate the previous year alone, using this: &lt;STRONG&gt;Sum ({$&amp;lt;Period = {$(=Max (Period)-1)} &amp;gt;} [Quantity])&lt;/STRONG&gt;, but I still get zero's.&amp;nbsp; Seems like it doesn't want to decrease by 1 or maybe it's a formatting thing, I don't really know. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 18:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652910#M238668</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2014-09-19T18:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652911#M238669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you selecting the Year in your User Interface (and not the period), in that case you will have to modify the set analysis to ignore your Year Selection..&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=if(isnull([Period]),'-',(sum([Quantity])-Sum ({$&amp;lt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff;"&gt;FiscalYear&lt;/SPAN&gt;=,&lt;/STRONG&gt; Period = {$(=Max (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Period &lt;/SPAN&gt;)-1)} &amp;gt;} [Quantity]))/Sum ({$&amp;lt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;FiscalYear =,&lt;/STRONG&gt;&lt;/SPAN&gt; Period= {$(=Max (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Period &lt;/SPAN&gt;)-1)} &amp;gt;} [Quantity]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try it out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 20:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652911#M238669</guid>
      <dc:creator>kedar_dandekar</dc:creator>
      <dc:date>2014-09-19T20:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652912#M238670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried it and got "-" in the results.&amp;nbsp; What you're saying makes sense and I'll probably have to incorporate your statement into the app after this issue is resolved.&amp;nbsp; Thank you for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm now thinking it has to format.&amp;nbsp; The periods are all two characters.&amp;nbsp; 01, 02, etc...&amp;nbsp; Formatted as text.&amp;nbsp; I can subtract one in an expression and it works fine.&amp;nbsp; I don't think it will work in a set analysis though.&amp;nbsp; I need to create a variable to convert Period to Num, but not having any luck with it.&amp;nbsp; Currently, it may be trying to subtract alpha from alpha.&amp;nbsp; If I convert it to number, set analysis may view it as number and return the previous period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could this be it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 20:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652912#M238670</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2014-09-19T20:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652913#M238671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could be one of the several reasons.. if you can upload a small sample of your application, it would help to locate the exact problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Sep 2014 04:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652913#M238671</guid>
      <dc:creator>kedar_dandekar</dc:creator>
      <dc:date>2014-09-20T04:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652914#M238672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A sample is attached.&amp;nbsp; Thank you in advance for taking a look at it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - I intentionally loaded two columns of "Periods".&amp;nbsp; One is text. The other, number.&amp;nbsp; That's how the original data is formatted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 12:38:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652914#M238672</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2014-09-23T12:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Set Analysis - Previous Period % Change</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652915#M238673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand why it was difficult with set analysis, when we add a dimension to the Pivot Table (e.g. FiscalYear) , it also filters data by that dimension (i.e. FiscalYear), and only the filtered data is available for the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for the row where FiscalYear = 2013, the data for that row gets filtered for 2013. Hence, even if we use multiple FiscalYears (2012, 2013) in our set analysis, it does not get data for 2012.&lt;/P&gt;&lt;P&gt;Also, the Set Analysis that we use, is evaluated once, i.e. not by each dimension row value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;To implement your task, I have used the Total function to ignore the dimensions while calculating the expressions&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, and in the Set Analysis I have used multiple If statements to take care of row by row calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find attached the updated qvw: &lt;STRONG&gt;Prev Period Test - Total.qvw&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 18:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-Period-Change/m-p/652915#M238673</guid>
      <dc:creator>kedar_dandekar</dc:creator>
      <dc:date>2014-10-02T18:44:44Z</dc:date>
    </item>
  </channel>
</rss>

