<?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 Creating a displayed month - previous month variance column in pivot table. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Creating-a-displayed-month-previous-month-variance-column-in/m-p/2081719#M88723</link>
    <description>&lt;P&gt;I've created a pivot table in one of my apps. I have a list of dimensions that represent various customer details such as company name. I then have measures set up where I can track sales performance, e.g. sales turnover, profit etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have comparison buttons that add new dimensions to the pivot table once clicked, one of these being the variance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to change the variance to a month on prev month, whereas currently it is year on previous year. So, for February, instead of the variance showing February 2023 against February 2022, I want it to show February 2023 variance against January 2023.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the previous code to calculate the sum of customer turnover:&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"$(=vRange_TY)"}&amp;gt;}[Sales Amount Turnover])&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;vRange_TY defines that the date range should look at this year (previous year variable = vRange_LY, I've tweaked this variable to&amp;nbsp;=MonthName([Date])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;New code to calc sum of customer turnover:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;}[Sales Amount Turnover])&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now, to calculate the variance measure, I created the below formula:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Above(sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;}[Sales Amount Turnover]))&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;} [Sales Amount Turnover])&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the data isn't correct, I've attached a screen shot of the returned data.&amp;nbsp; As you can see on row 5, March Sales £ CP (sales turnover) is &lt;STRONG&gt;£848&lt;/STRONG&gt;, and February is &lt;STRONG&gt;£1414,&lt;/STRONG&gt; the variance on this should be &lt;STRONG&gt;-£566&lt;/STRONG&gt;. However, the Sales £ Var (variance) shown under March is -&lt;STRONG&gt;£673.16&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Not sure what I've done wrong here. This is my first community post so I apologise if I've over/under explained or been vague on any parts of this. If you could let me know any additional details I'll happily provide.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109550i28DA0B735D8F98D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2023 09:00:07 GMT</pubDate>
    <dc:creator>HClegg</dc:creator>
    <dc:date>2023-06-12T09:00:07Z</dc:date>
    <item>
      <title>Creating a displayed month - previous month variance column in pivot table.</title>
      <link>https://community.qlik.com/t5/App-Development/Creating-a-displayed-month-previous-month-variance-column-in/m-p/2081719#M88723</link>
      <description>&lt;P&gt;I've created a pivot table in one of my apps. I have a list of dimensions that represent various customer details such as company name. I then have measures set up where I can track sales performance, e.g. sales turnover, profit etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have comparison buttons that add new dimensions to the pivot table once clicked, one of these being the variance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to change the variance to a month on prev month, whereas currently it is year on previous year. So, for February, instead of the variance showing February 2023 against February 2022, I want it to show February 2023 variance against January 2023.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the previous code to calculate the sum of customer turnover:&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"$(=vRange_TY)"}&amp;gt;}[Sales Amount Turnover])&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;vRange_TY defines that the date range should look at this year (previous year variable = vRange_LY, I've tweaked this variable to&amp;nbsp;=MonthName([Date])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;New code to calc sum of customer turnover:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;}[Sales Amount Turnover])&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now, to calculate the variance measure, I created the below formula:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Above(sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;}[Sales Amount Turnover]))&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;sum({$&amp;lt;Year=, Quarter=, Month=, Week=, Day= , Date = {"=MonthName([Date])"}&amp;gt;} [Sales Amount Turnover])&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the data isn't correct, I've attached a screen shot of the returned data.&amp;nbsp; As you can see on row 5, March Sales £ CP (sales turnover) is &lt;STRONG&gt;£848&lt;/STRONG&gt;, and February is &lt;STRONG&gt;£1414,&lt;/STRONG&gt; the variance on this should be &lt;STRONG&gt;-£566&lt;/STRONG&gt;. However, the Sales £ Var (variance) shown under March is -&lt;STRONG&gt;£673.16&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Not sure what I've done wrong here. This is my first community post so I apologise if I've over/under explained or been vague on any parts of this. If you could let me know any additional details I'll happily provide.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109550i28DA0B735D8F98D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 09:00:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Creating-a-displayed-month-previous-month-variance-column-in/m-p/2081719#M88723</guid>
      <dc:creator>HClegg</dc:creator>
      <dc:date>2023-06-12T09:00:07Z</dc:date>
    </item>
  </channel>
</rss>

