<?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: How to calculate change from prior year in table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225998#M23854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If you can use the Above() function for your calculation, it would be the easiest solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- You can't use Set Analysis in this chart (with the field Year being a Dimension) because Set Analysis conditions are only validated once, before the chart is even calculated, therefore they can't be sensitive to the values of your Dimensions (such as Year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In order to overcome the previous issue, developers often create a so called "As of Date" table - where the single Date field is being split into two fields - "Display Date" and "Transaction Date". The "As of Date" table contains both dates and a set of flags that determine the relationship between the two - for example, CYTD_Flag, PYTD_Flag, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find several free white papers describing the concept of the "As of Date" table, including my blog article here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/" title="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/"&gt;QlikView Blog Q-Tip #4 How to Use "As of Date" table | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also read a more detailed explanation with several hands-on exercises in my book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=CVZRHMG6CVR2FGTA"&gt;QlikView Your Business&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, you can learn this technique, along with many other advanced Qlik techniques, at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jan 2017 20:06:43 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2017-01-10T20:06:43Z</dc:date>
    <item>
      <title>How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225997#M23853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just cannot figure out the syntax and hope someone can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to display a table like this (simple version):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year, value, change from last year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2012, 10, -&lt;/P&gt;&lt;P&gt;2013, 11, 10%&lt;/P&gt;&lt;P&gt;2014, 12.1, 10%&lt;/P&gt;&lt;P&gt;2015, 24.2, 100%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need an expression for the 3rd column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual data is more complicated (it is year to date and there are other dimensions), but the expression should be something like this. (Current Year - Last Year)/Last Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(DISTINCT {&amp;lt;CountFlag={'1'},MonthNum={"&amp;lt;=$(=$(vCYTDMon))"},Month=,Year=,Quarter=,ReportingDate=,WeekStart=,Mode={'yyz'}&amp;gt;} Account) &lt;/P&gt;&lt;P&gt;- &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;count(DISTINCT {&amp;lt;CountFlag={'1'},MonthNum={"&amp;lt;=$(=$(vCYTDMon))"},Month=,Year={'(Year-1)'},Quarter=,ReportingDate=,WeekStart=,Mode={'yyz'}&amp;gt;} Account)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;count(DISTINCT {&amp;lt;CountFlag={'1'},MonthNum={"&amp;lt;=$(=$(vCYTDMon))"},Month=,Year={'(Year-1)'},Quarter=,ReportingDate=,WeekStart=,Mode={'yyz'}&amp;gt;} Account)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get that Year-1 concept into the set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried the Above() function, but I need this more precise approach to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 19:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225997#M23853</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2017-01-10T19:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225998#M23854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If you can use the Above() function for your calculation, it would be the easiest solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- You can't use Set Analysis in this chart (with the field Year being a Dimension) because Set Analysis conditions are only validated once, before the chart is even calculated, therefore they can't be sensitive to the values of your Dimensions (such as Year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In order to overcome the previous issue, developers often create a so called "As of Date" table - where the single Date field is being split into two fields - "Display Date" and "Transaction Date". The "As of Date" table contains both dates and a set of flags that determine the relationship between the two - for example, CYTD_Flag, PYTD_Flag, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find several free white papers describing the concept of the "As of Date" table, including my blog article here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/" title="http://www.naturalsynergies.com/q-tip-4-how-to-use-as-of-date-table/"&gt;QlikView Blog Q-Tip #4 How to Use "As of Date" table | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also read a more detailed explanation with several hands-on exercises in my book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=CVZRHMG6CVR2FGTA"&gt;QlikView Your Business&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, you can learn this technique, along with many other advanced Qlik techniques, at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 20:06:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225998#M23854</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2017-01-10T20:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225999#M23855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you; helpful to rule this out. I will go back to "above" function. Problem I have is that the data is like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year, other field, value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where other field is 2nd dimension. So "above" needs to point to several rows above the current row. I've tried using the offset, but it did not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 20:31:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1225999#M23855</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2017-01-10T20:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226000#M23856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;frustratingly, the above function will not do what I need. The data is sorted by year, otherfield. Above would work if the sort order were reversed, but that defeats the point of the presentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 21:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226000#M23856</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2017-01-10T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226001#M23857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can combine Above() with the AGGR() function, to overcome the challenge of incorrect sorting. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGGR(&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; above(Sum(Sales)),&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; OtherField, Year)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This AGGR function will sort the data by OtherFIeld first, and Year next. Make sure that the years are sorted properly in the data. If they are not, you can sort them within AGGR() :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;sum(&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGGR(&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&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;&amp;nbsp; above(Sum(Sales)),&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&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;&amp;nbsp; OtherField, &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&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;&amp;nbsp; (Year, NUMERIC, ASCENDING)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm quoting from memory, so double check the syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AGGR() is a powerful function, and it's relatively little-understood among developers. I'm teaching it with a lot of details at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - see if our agenda is right for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 21:54:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226001#M23857</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2017-01-10T21:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate change from prior year in table</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226002#M23858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this appears to work!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 22:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-calculate-change-from-prior-year-in-table/m-p/1226002#M23858</guid>
      <dc:creator>daveatkins</dc:creator>
      <dc:date>2017-01-10T22:52:09Z</dc:date>
    </item>
  </channel>
</rss>

