<?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 Calculating headcount variance year on year when data is already a total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-headcount-variance-year-on-year-when-data-is-already/m-p/1128375#M902373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to calculate a variance for headcount (as an example) year over year. In my example data set the headcount in May 2015 is 104, the headcount in May 2016 is 116 therefore the variance should be 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show two figures:&lt;/P&gt;&lt;P&gt;(1). The latest headcount of all the months selected e.g. if the year 2016 is selected, and months Jan, Feb, Mar, Apr &amp;amp; May are selected I would like the answer for headcount to be the headcount of May 2016 which in my example is 116.&lt;/P&gt;&lt;P&gt;(2). The variance of the headcount year on year, if year 2016 is selected, and months Jan, Feb, Mar, Apr &amp;amp; May are selected, so in this example May 2016 is 116, May 2015 is 104 so the answer should be 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have achieved (1) by the following expression using 'MonthYear' from my master calendar&lt;/P&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;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'$(=max ( MonthYear ))'} &amp;gt; }&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Headcount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But cannot work out an expression to calculate (2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached an example document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Calculating headcount variance year on year when data is already a total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-headcount-variance-year-on-year-when-data-is-already/m-p/1128375#M902373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to calculate a variance for headcount (as an example) year over year. In my example data set the headcount in May 2015 is 104, the headcount in May 2016 is 116 therefore the variance should be 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show two figures:&lt;/P&gt;&lt;P&gt;(1). The latest headcount of all the months selected e.g. if the year 2016 is selected, and months Jan, Feb, Mar, Apr &amp;amp; May are selected I would like the answer for headcount to be the headcount of May 2016 which in my example is 116.&lt;/P&gt;&lt;P&gt;(2). The variance of the headcount year on year, if year 2016 is selected, and months Jan, Feb, Mar, Apr &amp;amp; May are selected, so in this example May 2016 is 116, May 2015 is 104 so the answer should be 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have achieved (1) by the following expression using 'MonthYear' from my master calendar&lt;/P&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;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'$(=max ( MonthYear ))'} &amp;gt; }&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Headcount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But cannot work out an expression to calculate (2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached an example document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-headcount-variance-year-on-year-when-data-is-already/m-p/1128375#M902373</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating headcount variance year on year when data is already a total</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-headcount-variance-year-on-year-when-data-is-already/m-p/1128376#M902374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this for May 2015&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt; MonthYear={"$(=Date(MonthStart(AddYears(Max(MonthYear), -1)), 'MMM-YYYY'))"}&amp;gt;}Headcount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for variance:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;MonthYear = {'$(=Max(MonthYear))'}&amp;gt;} Headcount) - Sum({&amp;lt; MonthYear={"$(=Date(MonthStart(AddYears(Max(MonthYear), -1)), 'MMM-YYYY'))"}&amp;gt;}Headcount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/130835_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 10:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-headcount-variance-year-on-year-when-data-is-already/m-p/1128376#M902374</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-11T10:41:20Z</dc:date>
    </item>
  </channel>
</rss>

