<?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: Traffic simulation data analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635930#M476853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i understand, for example for r=1 you expect result 2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because there are vehicles 1,2,3,6, but vehicles 3 and 6 were only 1 time (1 sec).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2014 08:14:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-19T08:14:45Z</dc:date>
    <item>
      <title>Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635927#M476850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find myself stuck on the following problem:&lt;/P&gt;&lt;P&gt;I have some data from a traffic simulation where I have the data of individual vehicles per second (also see simpiflied example). There is a field containing every second per vehicle. The second field effectively is a collection of seconds (from the first field) to aggregate the data by. The third field contains unique ID codes per individual vehicle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each vehicle (v in the attached example) can have multiple timespans (I will call these 'timespans' for lack of a better explanation/word, r in the attached examples), meaning it can be in found in the simulation network during that time. I want to allocate each vehicle to the maximum timespan (r) in the dataset for analysis purposes, BUT! Only if it is part of that timespan (r) for equal or more than 2 seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made a straight table chart with the timespans (r) as dimension, and then using the following expression to count the distinct amount of vehicles (v) that are allocated to that timespan:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Count(DISTINCT If(r=Aggr(Max({1}r),v),v))&lt;/P&gt;&lt;P&gt;This works fine, but I don't want to just allocate the vehicles (v) to the maximum timespan (r), but the maximum timespan of which that vehicle is part for 2 or more seconds (t). I've tried the following expression, which gives an error and no result:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Count(DISTINCT If(r=Max({1}If(Aggr(Count(t),v,r)&amp;gt;=2,r)),v))&lt;/P&gt;&lt;P&gt;I already found out that the error is a result of the lack of a TOTAL qualifier, but I cannot get any results (or at least not those I am looking for)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find an example dataset / expressions in the attached example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 12:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635927#M476850</guid>
      <dc:creator />
      <dc:date>2014-05-16T12:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635928#M476851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;once again:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for you calculation interesting are only those rows, where r&amp;gt;=2??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 13:06:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635928#M476851</guid>
      <dc:creator />
      <dc:date>2014-05-16T13:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635929#M476852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I'm trying to achieve there is to alocate the vehicle (v) to the highest timespan (r) of which it is part at least 2 seconds. I count the seconds (t) and make sure it is 2 or higher, hence the &amp;gt;=2. I know I can simply Count(t), because the dataset only contains unique values for every vehicle (v) in this field, and that every second is in there once.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 07:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635929#M476852</guid>
      <dc:creator />
      <dc:date>2014-05-19T07:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635930#M476853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i understand, for example for r=1 you expect result 2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because there are vehicles 1,2,3,6, but vehicles 3 and 6 were only 1 time (1 sec).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635930#M476853</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635931#M476854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;vehicle 3 and 6 should indeed not be alocated to r=1, but not because of the time they are part of it. They are part of later timespans (r) for 2 seconds and thus should be alocated to those. The total expected results in a straight table with r as dimension would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r, count(v), concat(v)&lt;/P&gt;&lt;P&gt;1, 1, (2)&lt;/P&gt;&lt;P&gt;2, 2, (1, 3)&lt;/P&gt;&lt;P&gt;3, 1, (4)&lt;/P&gt;&lt;P&gt;4, 0, -&lt;/P&gt;&lt;P&gt;5, 1, (6)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example the only vehicle for which the result between checking for the max(r) of which it is part for at least 2 seconds would be vehicle 4, which is part of r=4 for only 1 second and is thus alocated to r=3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635931#M476854</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635932#M476855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this expression:&lt;/P&gt;&lt;P&gt;sum(if(aggr(Count(DISTINCT t),v,r)&amp;gt;=2,1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with r as dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should give result, i think, you need &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:30:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635932#M476855</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635933#M476856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, let me try again &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:31:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635933#M476856</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635934#M476857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression you propose will alocate each vehicle (v) to each timespan (r) of which it is part for at least two seconds, not just the latest &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to alocate each vehicle distinctly to only the highest value of r of which it is part for at least 2 seconds. This is why my formula contains the Max() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look in the qlikview help at the advanced aggregation section it states the requirement for the TOTAL qualifier. But using it will result in in alocating each vehicle to the overal Max(r)=5, and thus resulting in no (or wrong) results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, when using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(DISTINCT &lt;STRONG&gt;If(r=Max(TOTAL If(Aggr(Count(DISTINCT t),v,r)&amp;gt;=2,r)),v)&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the bold part of the function will check r (the dimension) against the Max(TOTAL r), which is 5 for each vehicle because of the TOTAL qualifier. Because only 1 vehicle is actually part of r=5, the expression will only yield the correct result on the last row of the table, showing 0 for each other row. Without the use of the TOTAL qualifier however it will yield no result at all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635934#M476857</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635935#M476858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just found the answer!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to aggregate the Max() using NODISTINCT for proper results &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one works:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(DISTINCT If(r=Aggr(NODISTINCT Max({1}If(Aggr(Count(DISTINCT t),v,r)&amp;gt;=2,r)),v),v))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for taking the time to help me out with this problem &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 08:59:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635935#M476858</guid>
      <dc:creator />
      <dc:date>2014-05-19T08:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635936#M476859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 09:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635936#M476859</guid>
      <dc:creator />
      <dc:date>2014-05-19T09:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Traffic simulation data analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635937#M476860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may also use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression:&lt;/P&gt;&lt;P&gt;count(DISTINCT v)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimension:&lt;/P&gt;&lt;P&gt;=aggr(max(aggr(NODISTINCT if(count(DISTINCT t)&amp;gt;1,r),v,r)),v)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with "Suppres when value is null" checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 21:32:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Traffic-simulation-data-analysis/m-p/635937#M476860</guid>
      <dc:creator />
      <dc:date>2014-05-19T21:32:54Z</dc:date>
    </item>
  </channel>
</rss>

