<?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: accumulation in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377131#M140623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you also post the relevant part of script? And have you sorted your input table appropriately?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2012 13:09:57 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-13T13:09:57Z</dc:date>
    <item>
      <title>accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377128#M140620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get a new field that is an accumulation of another field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can do this on front end - using &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RangeSum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LoginLogoff&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RowNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()))&amp;nbsp;&amp;nbsp; .&amp;nbsp; This works just fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am trying to do this during the intial load using -&amp;nbsp; if &lt;SPAN style="font-size: 8pt;"&gt; ((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Previous&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;iKeyPart1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;iKeyPart1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('ActiveLogins'),0)+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LoginLogoff&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActiveLogins &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is giving me strange results. it seems to be working until the accumulation reaches 3. Then i start seeing values that dont quite make sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="19816" class="jive-image-thumbnail jive-image" height="184" onclick="" alt="QV - Accumulation.png" src="/legacyfs/online/19816_QV - Accumulation.png" width="688" /&gt;&lt;/P&gt;&lt;P&gt;Need help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 21:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377128#M140620</guid>
      <dc:creator />
      <dc:date>2012-08-10T21:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377129#M140621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am quite unclear how your fields in the load script relate to the columns / dimensions in your chart.&lt;/P&gt;&lt;P&gt;For example, I can't see your iKeyPart1 field in the chart table. And in your chart, the column named Login / Logoff seems to have text values, while you numerically add this (same?) field in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post a small sample file? Upload is available in advanced editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 21:38:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377129#M140621</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-10T21:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377130#M140622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion. Hopefully this will make more sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20067" __jive_id="20067" class="jive-image-thumbnail jive-image" height="222" alt="QV - Accumulation.png" src="/legacyfs/online/20067_QV - Accumulation.png" width="602" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 13:05:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377130#M140622</guid>
      <dc:creator />
      <dc:date>2012-08-13T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377131#M140623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you also post the relevant part of script? And have you sorted your input table appropriately?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 13:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377131#M140623</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-13T13:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377132#M140624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is that part of the script -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load1:&lt;BR /&gt;LOAD Month(EventDateTime) as LogMonth,&lt;BR /&gt; Day(EventDateTime) as LogDay,&lt;BR /&gt; EventDateTime,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StreamId as stream,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StreamName,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DingoUserName as iKeyPart1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventResult,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventResultText,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventTrigger,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (EventTrigger='ClientRequest',1,-1) as LoginLogoff;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM raw_entitlement_journal&lt;BR /&gt;WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) &amp;lt;= EventDateTime and EventResultText = 'Success';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load2:&lt;BR /&gt;LOAD Month(EventDateTime) as LogMonth,&lt;BR /&gt; Day(EventDateTime) as LogDay,&lt;BR /&gt; EventDateTime,&lt;BR /&gt; stream,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StreamName,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iKeyPart1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventResult,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventResultText,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventTrigger,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginLogoff,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((Previous(iKeyPart1)=iKeyPart1),Peek('ActiveLogins'),0)+LoginLogoff as ActiveLogins&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Load1 Order by iKeyPart1, stream, EventDateTime;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pulasti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 13:13:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377132#M140624</guid>
      <dc:creator />
      <dc:date>2012-08-13T13:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377133#M140625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will create a lot of common fields between Load1 and Load2 table, resulting in a large synthetic key / table, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you dropped your first table Load1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 13:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377133#M140625</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-13T13:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377134#M140626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I had not dropped the table. But even after dropped the table, the numbers did not come out right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching the qv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for looking into it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pulasti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 13:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377134#M140626</guid>
      <dc:creator />
      <dc:date>2012-08-13T13:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377135#M140627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think a main issue here is that you've got multiple events (up to some 10)&amp;nbsp; per unique time stamp. In your example, you've got 2 Login events 8/6/2012 7:50:05 AM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your table, you only count and accumulate one event (try using sum(LoginLogoff) in your chart!), while the accumulated script field is ambiguous (two possible values for that Timestamp!) and thus a '-' is returned by QV (try for example using =min(ActiveLogins) in your chart expression!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you handle the multiple events accordingly, you should be able to fix your accumulation issue, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 14:14:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377135#M140627</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-13T14:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377136#M140628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great!&lt;/P&gt;&lt;P&gt;Thanks a lot Stefan. I did not realize that there could be multiple login/logoff events on subsecond level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is now working as expected!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 15:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377136#M140628</guid>
      <dc:creator />
      <dc:date>2012-08-13T15:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377137#M140629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;still struggling with similar issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me with the attached small example? The code is on tab main2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not getting LoginsOnThisHost counts ...most of them are NULL(?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 17:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377137#M140629</guid>
      <dc:creator />
      <dc:date>2012-08-17T17:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: accumulation in script</title>
      <link>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377138#M140630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using peek() instead of previous(). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I think you may need to sort also by EventDateTime?&lt;/P&gt;&lt;P&gt;If you are only interested in the sum(LoginLogoff), you can also use a group by load like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DingoLog2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DingoUserName, StreamId, DistalHostIp, sum(LoginLogoff) as LoginsOnThisHost2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident DingoLog group by DingoUserName, StreamId, DistalHostIp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table DingoLog;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 21:26:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/accumulation-in-script/m-p/377138#M140630</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-17T21:26:25Z</dc:date>
    </item>
  </channel>
</rss>

