<?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: Counting Simultaneous Tasks in Charts in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2138645#M92540</link>
    <description>&lt;P&gt;The question is more for what the timestamp-table is really needed? Means at first - is the time-part really essential? If, could the timestamp be separated into dates and times? Do you need to keep this information within an extra table or could the to the from-to period related information be joined/mapped to the facts and such intermediate logic dropped again?&lt;/P&gt;
&lt;P&gt;It means at all to transfer the essential logic into the data-model by optimizing it instead of optimizing the UI performance.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 06:27:52 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-11-17T06:27:52Z</dc:date>
    <item>
      <title>Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2138564#M92532</link>
      <description>&lt;P&gt;Hi! Could you tell me if there is a chart aggregation function that allows me to &lt;STRONG&gt;count simultaneous tasks&lt;/STRONG&gt;?&lt;BR /&gt;I'm currently generating the "Datetimes" table and then using the Aggr function on the measure.&lt;BR /&gt;The problem is that "Datetimes" has &lt;STRONG&gt;more than 40 million records&lt;/STRONG&gt; and &lt;STRONG&gt;performance is considerably degraded&lt;/STRONG&gt; by using the &lt;STRONG&gt;Aggr&lt;/STRONG&gt; function.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_4-1700165793624.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120024iF46A80B3744CE125/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_4-1700165793624.png" alt="JGMDataAnalysis_4-1700165793624.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_5-1700165809097.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120025i915691F19B7E493B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_5-1700165809097.png" alt="JGMDataAnalysis_5-1700165809097.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a more efficient way to obtain the same result?&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148"&gt;@rwunderlich&lt;/a&gt;, &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 20:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2138564#M92532</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-16T20:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2138645#M92540</link>
      <description>&lt;P&gt;The question is more for what the timestamp-table is really needed? Means at first - is the time-part really essential? If, could the timestamp be separated into dates and times? Do you need to keep this information within an extra table or could the to the from-to period related information be joined/mapped to the facts and such intermediate logic dropped again?&lt;/P&gt;
&lt;P&gt;It means at all to transfer the essential logic into the data-model by optimizing it instead of optimizing the UI performance.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 06:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2138645#M92540</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-17T06:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139786#M92649</link>
      <description>&lt;P&gt;Thank you very much,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;.&lt;BR /&gt;I split the &lt;STRONG&gt;TaskDateTime&lt;/STRONG&gt; field into &lt;STRONG&gt;TaskDate&lt;/STRONG&gt; and &lt;STRONG&gt;TaskTime&lt;/STRONG&gt;, respectively. By making this modification I noticed an improvement in performance, but I am still not satisfied with the result.&lt;BR /&gt;Then I tried joining the timestamp-table to the fact table but in this case I saw no difference. For this reason I decided to leave them separately.&lt;BR /&gt;As a basic premise, I need to &lt;STRONG&gt;calculate the concurrency of tasks based on the filters applied by users&lt;/STRONG&gt;.&lt;BR /&gt;To perform this calculation &lt;STRONG&gt;I must consider the tasks that were running in each second&lt;/STRONG&gt;, beyond the fact that in the charts I am going to use &lt;STRONG&gt;year&lt;/STRONG&gt;, &lt;STRONG&gt;month&lt;/STRONG&gt;, &lt;STRONG&gt;date&lt;/STRONG&gt; or &lt;STRONG&gt;hour&lt;/STRONG&gt; as dimensions.&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 302px; top: 133px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Nov 2023 12:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139786#M92649</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-21T12:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139829#M92653</link>
      <description>&lt;P&gt;You can create another table and take advantage of the way Qlik is dealing with cardinality:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;refTask:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load FieldValue('TaskID',RecNo()) as ID#,FieldValue('TaskID',RecNo()) as TaskIDKey AutoGenerate FieldValueCount('TaskID') ;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;And then, if you count TaskIDKey you don't need to put the Distinct and so this is using multiple threads and should offer better performances.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 13:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139829#M92653</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-11-21T13:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139857#M92656</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16701"&gt;@vincent_ardiet_&lt;/a&gt;.&lt;BR /&gt;I never considered the optimization you propose because some time ago I read an &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;&amp;nbsp;article explaining that the performance difference between &lt;STRONG&gt;Count&lt;/STRONG&gt; and &lt;STRONG&gt;Count Distinct&lt;/STRONG&gt; existed in &lt;STRONG&gt;older versions&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Design/A-Myth-About-Count-distinct/ba-p/1476053" target="_blank"&gt;https://community.qlik.com/t5/Design/A-Myth-About-Count-distinct/ba-p/1476053&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, I could do some tests.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 13:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139857#M92656</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-21T13:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139860#M92657</link>
      <description>&lt;P&gt;Indeed, I'm also curious to know the results.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 14:02:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139860#M92657</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-11-21T14:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139874#M92658</link>
      <description>&lt;P&gt;Some more questions. The fact-table or the resolved DateTime has 40 M of records? Further separating dates and times leads then to expressions like?&lt;/P&gt;
&lt;P&gt;max(aggr(count(distinct TaskID), TaskDate, TaskTime))&lt;/P&gt;
&lt;P&gt;or maybe:&lt;/P&gt;
&lt;P&gt;max(aggr(count(distinct TaskID), Year, Month, Date, Hour))&lt;/P&gt;
&lt;P&gt;Beside this the question - is an aggr() really needed by a table-chart with the dimension of:&amp;nbsp;Year + Month + Date + Hour? Because the number of distinct tasks within the applied dimensions would the normal:&amp;nbsp;count(distinct TaskID) return. By a KPI-object it might be different but here it would a single aggregation while the table-chart will perform it for each dimension-value.&lt;/P&gt;
&lt;P&gt;If minutes and second aren't relevant on the dimension-level they might be skipped in the aggr() and/or you could try to work with multiple DateTime- and/or Time-fields - means removing of granularity and providing a complete time-field with 86400 values and one without seconds and 1440 values and the next would already the hour with just 24 values - the last maybe also with a date respectively date + hour. Of course the extra fields will increase the size of the data-model but choosing the appropriate one within the relevant UI expressions may improve the performance.&lt;/P&gt;
&lt;P&gt;Further impact on the performance has the rest of the data-model. The best compromise in regard of simplicity, maintainability, efforts and performance is usually a star-scheme model. Especially link-table models should be avoided especially if the UI performance is the bottleneck.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 14:21:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139874#M92658</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-21T14:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139923#M92672</link>
      <description>&lt;P&gt;Thanks again, Marcus.&lt;BR /&gt;In principle, I must provide more information about the real context of the data.&lt;BR /&gt;What I called "tasks" in the example correspond in reality to "actions" associated with a &lt;BR /&gt;Provisioning System of a Telecommunications company.&lt;BR /&gt;These "actions" last a few seconds, except those executed through a CRON that can last several hours.&lt;BR /&gt;Under these circumstances, I understand that I am obliged to consider up to the second to &lt;BR /&gt;correctly calculate the number of concurrent "actions", regardless of whether the charts group up to the hour.&lt;/P&gt;
&lt;P&gt;Answering the questions:&lt;BR /&gt;- The resolved DateTime has 40 M of records&lt;BR /&gt;- max(aggr(count(distinct TaskID), TaskDate, TaskTime))&lt;/P&gt;
&lt;P&gt;Data Model Viewer:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_0-1700581830853.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120336i9B1E382F8F6F942D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_0-1700581830853.png" alt="JGMDataAnalysis_0-1700581830853.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If for the following example I used the measure max(aggr(count(distinct TaskID), Year, Month, Date, Hour)) I would get 2 as a result, which would not be correct because &lt;STRONG&gt;&lt;FONT color="#000000"&gt;only one task ran simultaneously&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_1-1700582045114.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120337i1D596CE18B370496/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_1-1700582045114.png" alt="JGMDataAnalysis_1-1700582045114.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Am I misunderstanding what you conveyed to me or, even worse, how Aggr works?&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 556px; top: 111px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Nov 2023 18:02:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139923#M92672</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-21T18:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139935#M92674</link>
      <description>&lt;P&gt;If you are sure to have one event each second, you could also try to sort the table by actionid and time, and using previous you can check if the same task was running 1 second before, create a flag with 0 in this case, else 1. In your UI you can then sum this flag.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 16:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139935#M92674</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-11-21T16:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139953#M92676</link>
      <description>&lt;P&gt;In simple terms, I have tasks that start and end. Based on this, I should be able to calculate the maximum number of tasks that ran simultaneously in a given year, month, week, date or date + hour according to the selections made by the user. For this last reason, I consider that it is not possible to precompute a flag because I cannot know in advance which registers will come into play.&lt;/P&gt;
&lt;P&gt;It helps me to think of it as one-second partitions into which tasks will fit according to their duration.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_0-1700587162785.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120342i0C139CD5A21916BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_0-1700587162785.png" alt="JGMDataAnalysis_0-1700587162785.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 580px; top: 1px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Nov 2023 17:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2139953#M92676</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-21T17:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140151#M92687</link>
      <description>&lt;P&gt;Ok I see, indeed difficult to get rid of the count in this case...&amp;nbsp;&lt;BR /&gt;Have you tried my proposal to avoid the Distinct with the refTasks table? Is it giving better performance or not?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 08:02:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140151#M92687</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-11-22T08:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140155#M92689</link>
      <description>&lt;P&gt;Yes, it makes it more clear and I missed that you don't want to count all tasks else only the ones which runs simultaneously. Further that's intended to show the max. value of them in regard to a certain period-dimension and some selections within them. Especially the last requirement is quite hard to optimize by a pure UI approach because it will always need an aggr() to evaluate the results of the count-aggregation. Any kinds of pre-aggregation seems not to be feasible but I wouldn't discard them too easily as impossible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beside this I could imagine that an approach like suggested from&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/16701"&gt;@vincent_ardiet_&lt;/a&gt;&amp;nbsp;might be suitable to improve the UI performance by evaluating some essential information already within the data-model by using interrecord-functions. Maybe with something like this:&lt;/P&gt;
&lt;P&gt;t: load id, start, end, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(start &amp;lt; previous(end), 1, 0) as flag,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(start &amp;lt; previous(end), previous(id)) as id_join&lt;BR /&gt;&amp;nbsp; &amp;nbsp; resident source order by start;&lt;/P&gt;
&lt;P&gt;m: mapping load&amp;nbsp;id_join, 1 resident t where flag = 1;&lt;/P&gt;
&lt;P&gt;x: load id, start, end, if(flag, flag, applymap('m', id, 0)) as flag&lt;BR /&gt;&amp;nbsp; &amp;nbsp; resident t;&lt;/P&gt;
&lt;P&gt;It's a bit simplified and may need some more if-conditions and/or flag-fields respectively more logic to handle the overlapping of n records and/or challenges in regard to the sorting.&lt;/P&gt;
&lt;P&gt;The above approach would be applied within the facts and not in the separate DateTime-table and checked the previous end-date against the current start-date and flagged it as well as providing the previous id which is used within the later mapping to add the flag also this record - because they belong together.&lt;/P&gt;
&lt;P&gt;With such a flag as selection or as a set analysis condition the virtual-tables behind the count() and the on-top aggr() could be reduced and the UI performance should become better. Of course it will depend on the rate of how many records could be exclude - by just 2% - 3% it won't be probably noticeable but by &amp;gt; 30% it should be significantly.&lt;/P&gt;
&lt;P&gt;Further thinkable would be to calculate the timestamps of the records against each other to get their differences and group them as within 1 or 24 hours or a day/month and various other stuff which might be also usable as restrictions within the calculation or maybe even as base for any pre-aggregation.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 08:20:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140155#M92689</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-22T08:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140472#M92733</link>
      <description>&lt;P&gt;Thanks, Marcus.&lt;BR /&gt;The flag you propose allows you to identify those "tasks" that do not overlap with any other &lt;STRONG&gt;at any time&lt;/STRONG&gt;.&lt;BR /&gt;I understand that I should generate a similar flag but in the separate &lt;SPAN&gt;DateTime-table&lt;/SPAN&gt;, according to the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;INNER JOIN (Datetime)
LOAD
    TaskDate,
    TaskTime,
    If(Count(Distinct TaskID) &amp;gt; 1, 1, 0) AS Flag
RESIDENT
    Datetime
GROUPED BY
    TaskDate,
    TaskTime
;&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;RangeMax(Max({&amp;lt;Flag = {1}&amp;gt;} Aggr(Count({&amp;lt;Flag = {1}&amp;gt;} Distinct TaskID), TaskDate, TaskTime), 1)&lt;/LI-CODE&gt;
&lt;P&gt;For the following example (as I understand it) the flag that you suggested would mark all tasks at 1 and&lt;BR /&gt;as a consequence, all their 1 second partitions would remain.&lt;/P&gt;
&lt;P&gt;On the other hand, with the flag calculated on the table you could keep filtering only those partitions &lt;BR /&gt;that have more than one associated task.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JGMDataAnalysis_0-1700671947185.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120433i723AC858D74DBB38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JGMDataAnalysis_0-1700671947185.png" alt="JGMDataAnalysis_0-1700671947185.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I did a quick test on the real data and was able to notice that the implementation of the flag &lt;BR /&gt;in the DateTime-table allows me to exclude approximately 35% of the records, which is reflected &lt;BR /&gt;in the UI performance.&lt;/P&gt;
&lt;P&gt;I would like to explore the last optimization option you mentioned but I didn't fully understand it. &lt;BR /&gt;Can you include a simple example in code?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Further thinkable would be to calculate the timestamps of the records against each other to get their differences and group them as within 1 or 24 hours or a day/month and various other stuff which might be also usable as restrictions within the calculation or maybe even as base for any pre-aggregation.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 17:25:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140472#M92733</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-22T17:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140474#M92734</link>
      <description>&lt;P&gt;I did the test but didn't notice any difference, unfortunately.&lt;BR /&gt;Thanks, Vincent.&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: -112px; top: -21px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Nov 2023 17:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140474#M92734</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2023-11-22T17:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Simultaneous Tasks in Charts</title>
      <link>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140488#M92735</link>
      <description>&lt;P&gt;Your method to use a self-joining aggregation-load to add the flag to the DateTime-table is definitely an alternatively. I'm not sure in which table the flag would improve the UI performance more. Personally I would assume it's the shorter fact-table and I would also think that the interrecord-approach may run faster as the aggregation-load. But you could just test it against each other.&lt;/P&gt;
&lt;P&gt;By the last I hinted for the possibility not just to create a flag else also to calculate the time-differences between the current start-time and the previous end-time and in a second measure these differences might be accumulated and the next measure might be to group these accumulations into hours/dates/months. In a similar way might the above flag or another one be used to accumulated the number of tasks within a row - means the flag-value mustn't be just 0 or 1 else might be 2, 3, 4, 5, .... and in the set analysis the condition is: flag = {"&amp;gt;=1"}&lt;/P&gt;
&lt;P&gt;Like above mentioned I'm not sure how to use such offset/grouping and/or further/extended flag-values in a sensible manner to reduce the data-set for the aggr() or maybe further aggregations in the script but there might be pattern which are useful - especially if there are clear rules how to handle hour/date/month overlapping tasks which would it makes easier to reset flags/accumulations in their regard as well as to the risk of counting them twice.&lt;/P&gt;
&lt;P&gt;At last if the second-parts are needed to determine the belonging to overlapping tasks and the flag would fulfill this requirement but the lowest granularity to display the counting is the hour you may remove the minutes and seconds from the data-model respectively you don't need to create them (if tries to create the flags within the fact-table and only afterwards creating the DateTime-table).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 18:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Counting-Simultaneous-Tasks-in-Charts/m-p/2140488#M92735</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-22T18:12:35Z</dc:date>
    </item>
  </channel>
</rss>

