<?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 the difference from yesterday to today in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318291#M711584</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answering, understand it's a bit theoretical &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I've added a zip file with an example.&lt;/P&gt;&lt;P&gt;If you look at it you see that the difference between&lt;/P&gt;&lt;P&gt;20110504 and 20110505 should be&amp;nbsp; 21 - 16 = 5 but in the application it adds up to -2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 May 2011 00:16:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-24T00:16:16Z</dc:date>
    <item>
      <title>Calculating the difference from yesterday to today</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318289#M711582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have excel files being extracted from a system each day. The files contain the number of orders coming in and going out. For every order I get a 1 in the out and&amp;nbsp; in row.&lt;/P&gt;&lt;P&gt;I would like to calculate the difference between two days.&lt;/P&gt;&lt;P&gt;sum of all going out orders today - sum of all going out orders yesterday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried this but can't get it to work properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if(peek('MonthNr') &amp;lt;&amp;gt; MonthNr,NewOrder,NewOrder-peek('NewOrder')) as NewOrderDiff&lt;/P&gt;&lt;P&gt;Order by&lt;/P&gt;&lt;P&gt;%ORDERKEY,&lt;/P&gt;&lt;P&gt; CostPlace,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Period,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can try and put together an example if it doesn't make sense. Is there something wrong with my order by statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 00:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318289#M711582</guid>
      <dc:creator />
      <dc:date>2011-05-23T00:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the difference from yesterday to today</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318290#M711583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you can only use order by on resident tables so that might be your problem (but I can't tell from what you posted).&amp;nbsp; I would also make sure it's sorted before you calculate NewOrderDiff b/c if you don't it's going to screw all your calculations up since you are using peek.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 21:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318290#M711583</guid>
      <dc:creator />
      <dc:date>2011-05-23T21:03:04Z</dc:date>
    </item>
    <item>
      <title>Calculating the difference from yesterday to today</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318291#M711584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answering, understand it's a bit theoretical &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I've added a zip file with an example.&lt;/P&gt;&lt;P&gt;If you look at it you see that the difference between&lt;/P&gt;&lt;P&gt;20110504 and 20110505 should be&amp;nbsp; 21 - 16 = 5 but in the application it adds up to -2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 00:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318291#M711584</guid>
      <dc:creator />
      <dc:date>2011-05-24T00:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the difference from yesterday to today</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318292#M711585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would just add a table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewTable:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum(New) as 'Sum of New'&lt;/P&gt;&lt;P&gt;RESIDENT MembershipsTemp2&lt;/P&gt;&lt;P&gt;GROUP BY Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally I think the way your table is set up in QV is going to cause some problems.&amp;nbsp; I'm not really a database expert or anything but you've got a ton of duplicates in there and I just don't really think that is the best way to set it up.&amp;nbsp; Since I don't really know any background it could be the best way but it looks a little weird to me.&amp;nbsp; I think all that data should probably be in more than one table but then again, I don't really know for sure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 14:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-difference-from-yesterday-to-today/m-p/318292#M711585</guid>
      <dc:creator />
      <dc:date>2011-05-24T14:14:36Z</dc:date>
    </item>
  </channel>
</rss>

