<?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: Sum for previous month with month as dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686458#M52292</link>
    <description>Hi , Have tried in Backend please find the below script&lt;BR /&gt;&lt;BR /&gt;date_values:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;peek("Sum data") as previous_month_record;&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;"Month",&lt;BR /&gt;"Sum data"&lt;BR /&gt;FROM [lib://data/date_values.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;Out put:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 20 Mar 2020 11:47:43 GMT</pubDate>
    <dc:creator>ruparaja</dc:creator>
    <dc:date>2020-03-20T11:47:43Z</dc:date>
    <item>
      <title>Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686411#M52277</link>
      <description>&lt;P&gt;Say I have the following table where month is a dimension. Sum data is calculated with Sum(data)&lt;/P&gt;&lt;TABLE border="0" width="239px" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;Month&lt;/TD&gt;&lt;TD width="116px"&gt;Sum data&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;01/07/2019&lt;/TD&gt;&lt;TD width="116px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;01/08/2019&lt;/TD&gt;&lt;TD width="116px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;01/09/2019&lt;/TD&gt;&lt;TD width="116px"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;01/10/2019&lt;/TD&gt;&lt;TD width="116px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="123px" height="17"&gt;01/11/2019&lt;/TD&gt;&lt;TD width="116px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I calculate the sum for the previous month, i.e.&lt;/P&gt;&lt;TABLE border="0" width="240" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="80" height="17"&gt;Month&lt;/TD&gt;&lt;TD width="80"&gt;Sum data&lt;/TD&gt;&lt;TD width="80"&gt;Sum data previous month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;01/07/2019&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;01/08/2019&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;01/09/2019&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;01/10/2019&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;01/11/2019&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686411#M52277</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2024-11-16T02:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686417#M52279</link>
      <description>&lt;P&gt;Try in chart second expression like:&lt;/P&gt;&lt;P&gt;=Above( Sum(Sales))&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 09:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686417#M52279</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-03-20T09:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686425#M52280</link>
      <description>&lt;P&gt;Hi, thanks a lot for your reply.&lt;/P&gt;&lt;P&gt;I thought I would make the question as simple as possible but it seems to have been a mistake, I wasn't able to fully convey what I want to do.&lt;/P&gt;&lt;P&gt;The data I have also contains a second dimension, "saleperson". What I am trying to accomplish is calculate how much John did this month vs how he did in the previous month, same for Mike.&lt;/P&gt;&lt;P&gt;I can't seem to be able to use above() for this, since it return the other sales person record. Any ideas how what I am trying to do can be done?&lt;/P&gt;&lt;TABLE width="527"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="138px" height="47px"&gt;Month&lt;/TD&gt;&lt;TD width="139px" height="47px"&gt;Salesperson&lt;/TD&gt;&lt;TD width="80px" height="47px"&gt;Sum data&lt;/TD&gt;&lt;TD width="169px" height="47px"&gt;% increase&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="138px" height="25px"&gt;01/07/2019&lt;/TD&gt;&lt;TD width="139px" height="25px"&gt;John&lt;/TD&gt;&lt;TD width="80px" height="25px"&gt;10&lt;/TD&gt;&lt;TD width="169px" height="25px"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="138px" height="25px"&gt;01/07/2019&lt;/TD&gt;&lt;TD width="139px" height="25px"&gt;Mike&lt;/TD&gt;&lt;TD width="80px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="169px" height="25px"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="138px" height="25px"&gt;01/08/2019&lt;/TD&gt;&lt;TD width="139px" height="25px"&gt;John&lt;/TD&gt;&lt;TD width="80px" height="25px"&gt;100&lt;/TD&gt;&lt;TD width="169px" height="25px"&gt;900% (from 10 to 100)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="138px" height="25px"&gt;01/08/2019&lt;/TD&gt;&lt;TD width="139px" height="25px"&gt;Mike&lt;/TD&gt;&lt;TD width="80px" height="25px"&gt;20&lt;/TD&gt;&lt;TD width="169px" height="25px"&gt;300% (from 5 to 20)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 10:25:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686425#M52280</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2020-03-20T10:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686428#M52281</link>
      <description>&lt;P&gt;To achieve similar output in chart - it would be easier if you could change the chart construct a bit. Put Salesperson as dimension (rows) and bring the months in column, then you could use before() like above() to get the variance. Otherwise, you could take a script-route to calculate it.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 10:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686428#M52281</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-03-20T10:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686432#M52283</link>
      <description>&lt;P&gt;I am not sure I understand how I can put the months in columns without it aggregating aggregating all the sales numbers for a single Saleperson over the entire months.&lt;/P&gt;&lt;P&gt;However, I simply want to get the number I've explained above (month of month % difference of sales for a single saleperson). I may want to plot this in a graph, and not in a table. How would you approach this using scripting?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 10:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686432#M52283</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2020-03-20T10:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686438#M52284</link>
      <description>&lt;P&gt;If you have more than two months data, how would you like the output to be?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 10:59:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686438#M52284</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-03-20T10:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686441#M52285</link>
      <description>&lt;P&gt;The value I am trying to calculate is:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;John's value for month M&lt;/FONT&gt; = % difference (Sum of sales for John in Month M,&amp;nbsp;Sum of sales for John in Month M - 1)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Mikes's value for month M&lt;/FONT&gt; = % difference (Sum of sales for Mike in Month M,&amp;nbsp;Sum of sales for Mike in Month M - 1)&lt;/P&gt;&lt;P&gt;So the output could be, for instance, a bar chart, with the dimension being the month, and for each month M &lt;STRONG&gt;two bars&lt;/STRONG&gt; are shown, one&amp;nbsp;for &lt;FONT color="#0000FF"&gt;Mikes's value for month M&lt;/FONT&gt; and one for&amp;nbsp;&lt;FONT color="#FF6600"&gt;John's value for month M.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Or we could imagine a line chart, where dimensions (x axis), is again month, or time, and each line represents the salesperson's % difference of the month vs the previous month.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686441#M52285</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2020-03-20T11:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686442#M52286</link>
      <description>&lt;P&gt;Why &lt;STRONG&gt;two bars&lt;/STRONG&gt; always, number or salesperson also could be many right?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:17:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686442#M52286</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-03-20T11:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686446#M52287</link>
      <description>&lt;P&gt;Yes correct. I said two&amp;nbsp;in the context of the example with our two salesperson, but there will be more than two in reality.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:22:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686446#M52287</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2020-03-20T11:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686458#M52292</link>
      <description>Hi , Have tried in Backend please find the below script&lt;BR /&gt;&lt;BR /&gt;date_values:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;peek("Sum data") as previous_month_record;&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;"Month",&lt;BR /&gt;"Sum data"&lt;BR /&gt;FROM [lib://data/date_values.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;Out put:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:47:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686458#M52292</guid>
      <dc:creator>ruparaja</dc:creator>
      <dc:date>2020-03-20T11:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for previous month with month as dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686464#M52293</link>
      <description>&lt;P&gt;Hello, thanks for answering. I have tried it, but I am not quite sure how this expands on using Above(). The issue I am having is deeper than my original question. Please see the conversations abovee Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 11:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-previous-month-with-month-as-dimension/m-p/1686464#M52293</guid>
      <dc:creator>johnnyjohn</dc:creator>
      <dc:date>2020-03-20T11:58:10Z</dc:date>
    </item>
  </channel>
</rss>

