<?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: Read SQL data by data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451729#M168550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I've discovered the problem for previous() function. Once I solve it, the problem is other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function "peek(Accum)" returns a complete sum of the whole column till that row, despite of one of them the value was just "progress"(when the condition Activity=previous(Activity) is false). In the next row it returns the whole sum again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Apr 2013 13:30:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-17T13:30:42Z</dc:date>
    <item>
      <title>Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451721#M168542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read an SQL table data by data. I want this because I want to have the name of the columns as a data, remove all zeros and get some extra information. An example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the database the source table is like (but with a lot of columns more):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Activity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;10/04/2013&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;11/04/2013&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;12/04/2013&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act1&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1.2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act3&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read that table and transform in one like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Activity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Progress&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Accummulated&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act1&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;10/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1.2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act1&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;11/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;3.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;11/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;12/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act3&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;12/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done this in a macro excel but I don't know how to do this in QlikView, any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Apr 2013 06:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451721#M168542</guid>
      <dc:creator />
      <dc:date>2013-04-13T06:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451722#M168543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the crosstable function for this. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;crosstable(Date, Progress,1)&lt;/P&gt;&lt;P&gt;load * from &lt;EM&gt;...somewhere...;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Load Activity, Date, Progress, &lt;/P&gt;&lt;P&gt;if(Activitity=previous(Activity),rangesum(Progress,previous(Progress)),Progress) as Accummulated&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;where Progress &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;order by Activity, Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Temp:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Apr 2013 09:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451722#M168543</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-04-13T09:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451723#M168544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Gysbert!!! The dates are right. I didn't know the crosstable function. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with the accummulate quantity. Using your code, the sum is for the last 2 progress. I need a way to sum the progress in that row plus accummulate till last one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Apr 2013 07:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451723#M168544</guid>
      <dc:creator />
      <dc:date>2013-04-14T07:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451724#M168545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please explain what you need. I don't understand your requirement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 08:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451724#M168545</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-04-15T08:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451725#M168546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry, I'll try to explain it better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the example I put yesterday, it works, but because there are 2 entries for each activity, with 3 or more it doesn't work because the accumulated quantity is more than the progress of one row and just one previous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="background-color: #ffffff; border: 1px solid #000000; margin: 1px 0; padding: 3px; color: #737373; font-family: Arial;"&gt;&lt;TBODY&gt;&lt;TR style="border: 0px;"&gt;&lt;TH align="center" style="border: 1px solid #000000; background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Activity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="border: 1px solid #000000; background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="border: 1px solid #000000; background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Progress&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="border: 1px solid #000000; background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Accumulated&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR style="border: 0px;"&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;Act4&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;11/04/2013&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px;"&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;Act4&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;12/04/2013&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px;"&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;Act4&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;13/04/2013&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; margin: 1px; padding: 3px; text-align: center;"&gt;&lt;P&gt;7&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;Act4&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;14/04/2013&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;4&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the previous table, the accumulated quantity in the latest row it's 11, and with your code it's 6 (the sum of the progress of that row and previous one, not all of previous).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way to get that accumulated value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 09:07:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451725#M168546</guid>
      <dc:creator />
      <dc:date>2013-04-15T09:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451726#M168547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;if(Activitity=previous(Activity)&lt;/SPAN&gt;, numsum(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Progress&lt;/SPAN&gt;,Peek(&lt;STRONG style="background-color: #6690bc; color: #ffffff; font-family: Arial; text-align: -webkit-center;"&gt;Accumulated&lt;/STRONG&gt;))) as &lt;STRONG style="background-color: #6690bc; color: #ffffff; font-family: Arial; text-align: -webkit-center;"&gt;Accumulated&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 11:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451726#M168547</guid>
      <dc:creator />
      <dc:date>2013-04-15T11:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451727#M168548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah. I see my mistake now. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;CrossTable(Date,Progress,1)&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity, 10/04/2013, 11/04/2013, 12/04/2013, 13/04/2013, 14/04/2013&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Act1, 1.2, 2, 0, 0, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Act2, 0, 3, 2, 0, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Act3, 0, 0, 1, 0, 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Act4, 0, 3, 2, 2, 4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Temp2:&lt;/P&gt;&lt;P&gt;Load Activity, Date, Progress,&lt;/P&gt;&lt;P&gt;if(Activity=previous(Activity),rangesum(Progress,peek(Accummulated)),Progress) as Accummulated&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;order by Activity, Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;load * Resident Temp2&lt;/P&gt;&lt;P&gt;where Progress &amp;lt;&amp;gt; 0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Temp, Temp2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 12:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451727#M168548</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-04-15T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451728#M168549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why Previous() is not giving me the previous data, it always returns the same value than Activity. It's seems like previous is doing nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, Activity = previous(Activity) and Accumulated is the sum of the hole column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks agains. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 12:51:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451728#M168549</guid>
      <dc:creator />
      <dc:date>2013-04-17T12:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451729#M168550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I've discovered the problem for previous() function. Once I solve it, the problem is other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function "peek(Accum)" returns a complete sum of the whole column till that row, despite of one of them the value was just "progress"(when the condition Activity=previous(Activity) is false). In the next row it returns the whole sum again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 13:30:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451729#M168550</guid>
      <dc:creator />
      <dc:date>2013-04-17T13:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read SQL data by data</title>
      <link>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451730#M168551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally it's working with your instructions, thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Apr 2013 06:48:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-SQL-data-by-data/m-p/451730#M168551</guid>
      <dc:creator />
      <dc:date>2013-04-20T06:48:11Z</dc:date>
    </item>
  </channel>
</rss>

