<?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 Need to compare data with previous date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471392#M176058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to compare two results, which is easy.The problem is that I dont want to compare with last year or similar but with the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex. data&lt;/P&gt;&lt;P&gt;date, item, number&lt;/P&gt;&lt;P&gt;11/06/13, 1, 140&lt;/P&gt;&lt;P&gt;16/06/13, 2, 133&lt;/P&gt;&lt;P&gt;18/06/13, 2, 50&lt;/P&gt;&lt;P&gt;18/06/13, 2, 60&lt;/P&gt;&lt;P&gt;22/06/13, 3, 98&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is to compare and see if the sum of the numbers on the 18nd is lower or higher than it was on the 16th.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried with FirstSortedValue, but cant that to really work, only works with the first value not second/third and so on...&lt;/P&gt;&lt;P&gt;This is how I did the code in a text-box just to get it working;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13711343142833503" jivemacro_uid="_13711343142833503"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue({$&amp;lt;item={'2'}&amp;gt;}TOTAL number ,-date, 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..and this doesnt show anything, not even a null. If I have a '1' last it shows right but only one of the numbers and not the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way to solve my problem, or is it just some syntax error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 14:45:56 GMT</pubDate>
    <dc:creator>t_hylander</dc:creator>
    <dc:date>2013-06-13T14:45:56Z</dc:date>
    <item>
      <title>Need to compare data with previous date</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471392#M176058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to compare two results, which is easy.The problem is that I dont want to compare with last year or similar but with the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex. data&lt;/P&gt;&lt;P&gt;date, item, number&lt;/P&gt;&lt;P&gt;11/06/13, 1, 140&lt;/P&gt;&lt;P&gt;16/06/13, 2, 133&lt;/P&gt;&lt;P&gt;18/06/13, 2, 50&lt;/P&gt;&lt;P&gt;18/06/13, 2, 60&lt;/P&gt;&lt;P&gt;22/06/13, 3, 98&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is to compare and see if the sum of the numbers on the 18nd is lower or higher than it was on the 16th.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried with FirstSortedValue, but cant that to really work, only works with the first value not second/third and so on...&lt;/P&gt;&lt;P&gt;This is how I did the code in a text-box just to get it working;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13711343142833503" jivemacro_uid="_13711343142833503"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue({$&amp;lt;item={'2'}&amp;gt;}TOTAL number ,-date, 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..and this doesnt show anything, not even a null. If I have a '1' last it shows right but only one of the numbers and not the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way to solve my problem, or is it just some syntax error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 14:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471392#M176058</guid>
      <dc:creator>t_hylander</dc:creator>
      <dc:date>2013-06-13T14:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare data with previous date</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471393#M176059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you can do this within the script by looking at the previous record.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Have a look at this post: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/message/110317#110317#110317"&gt;http://community.qlik.com/message/110317#110317&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 15:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471393#M176059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-13T15:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare data with previous date</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471394#M176060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I rather not do it in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried a couple of diffrent syntaxes but does sum the two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Made a quick demo, check it out.&lt;/P&gt;&lt;P&gt;Just too see if it works I simple threw it in a textbox. Works if I just have one value per day, but as soon I add one row with same date it wont show.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;/Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 09:28:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-compare-data-with-previous-date/m-p/471394#M176060</guid>
      <dc:creator>t_hylander</dc:creator>
      <dc:date>2013-06-20T09:28:21Z</dc:date>
    </item>
  </channel>
</rss>

