<?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 time difference between dates in the same column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600742#M737677</link>
    <description>&lt;P&gt;Is this what you are trying to do? Per 10 min interval count how many transactions that are in violation of your defined threshold interval?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15192i225F930DABB6798A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 07:15:43 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2019-07-10T07:15:43Z</dc:date>
    <item>
      <title>counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600195#M737674</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an issue with how to proceed with an expression for counting the time difference in the column "Period" which is included in the format 'M/D/YYY hh:mm'. I need to find if the value mentioned is going below a limit continuously ( present as a different field) over a period of 10 minutes and count every occurrence as 1 . I've attached the sample data below.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the help!&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Elements&lt;/TD&gt;&lt;TD&gt;Period&lt;/TD&gt;&lt;TD&gt;value&lt;/TD&gt;&lt;/TR&gt;&lt;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D&gt;356&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600195#M737674</guid>
      <dc:creator>Qliksense7</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600197#M737675</link>
      <description>&lt;P&gt;You did not provide any information on the period field used for comparison so in my example below is called "ComparingPeriod".&lt;/P&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;Count({&amp;lt;&amp;nbsp; Period= {"&amp;gt;$(=only(ComparingPeriod)- interval#(10,'mm'))&amp;lt;=$(=only(ComparingPeriod))"}&amp;nbsp;&amp;nbsp; &amp;gt;}Elements)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 05:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600197#M737675</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-07-09T05:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600198#M737676</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;So for say the low limit is 370 and in this set of values for 10 minutes interval if its goes all below 370 my count should produce a 1 or else its 0. So it has to scan through the 'period ' for every 10 minutes to check that if the values falls below the low limit set&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 05:49:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600198#M737676</guid>
      <dc:creator>Qliksense7</dc:creator>
      <dc:date>2019-07-09T05:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600742#M737677</link>
      <description>&lt;P&gt;Is this what you are trying to do? Per 10 min interval count how many transactions that are in violation of your defined threshold interval?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15192i225F930DABB6798A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 07:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600742#M737677</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-07-10T07:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600788#M737679</link>
      <description>&lt;P&gt;I used the followint expression in my solution above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sum(
  aggr(
  -1* (  only(LL) &amp;gt; L
      OR 
      only(HL) &amp;lt; L
   ),
   Element, [Element timestamp])
   )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is as follows:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;LOAD * INLINE [
Element,LL,HL
a,100,150
b,20,24

];

Transactions:
LOAD Element, timestamp#([TimeStampField], 'D/M/YYYY h:mm') as [Element timestamp], 
Time(floor(timestamp#([TimeStampField], 'D/M/YYYY h:mm'), 10 / 1440)) as [Element time],
L 
inline [
Element, TimeStampField, L
b,6/1/2019 0:00,23
b,6/1/2019 0:01,12
b,6/1/2019 0:02,32
b,6/1/2019 0:03,45
b,6/1/2019 0:04,65
b,6/1/2019 0:05,34
b,6/1/2019 0:06,76
b,6/1/2019 0:07,27
b,6/1/2019 0:08,12
b,6/1/2019 0:09,32
b,6/1/2019 0:10,14
b,6/1/2019 0:21,25
b,6/1/2019 0:11,14
b,6/1/2019 0:12,35
b,6/1/2019 0:13,48
b,6/1/2019 0:14,61
b,6/1/2019 0:15,32
b,6/1/2019 0:16,73
b,6/1/2019 0:17,24
b,6/1/2019 0:18,15
b,6/1/2019 0:19,36
b,6/1/2019 0:20,12
a,6/1/2019 0:00,123
a,6/1/2019 0:01,212
a,6/1/2019 0:02,332
a,6/1/2019 0:03,145
a,6/1/2019 0:04,265
a,6/1/2019 0:05,334
a,6/1/2019 0:06,376
a,6/1/2019 0:07,227
a,6/1/2019 0:08,112
a,6/1/2019 0:09,132
a,6/1/2019 0:10,314
a,6/1/2019 0:21,225
a,6/1/2019 0:11,114
a,6/1/2019 0:12,235
a,6/1/2019 0:13,248
a,6/1/2019 0:14,261
a,6/1/2019 0:15,132
a,6/1/2019 0:16,373
a,6/1/2019 0:17,224
a,6/1/2019 0:18,115
a,6/1/2019 0:19,336
a,6/1/2019 0:20,212];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 08:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1600788#M737679</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-07-10T08:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: counting time difference between dates in the same column</title>
      <link>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1608190#M737680</link>
      <description>&lt;P&gt;Did Vegar's posts help you resolve your issue?&amp;nbsp; If so, please be sure to give him credit by clicking the Accept as Solution button on the post(s) that helped, or you can leave a reply confirming they did, and we can mark things.&amp;nbsp; If you are still trying to figure things out, please leave an update with where things stand.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 17:47:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/counting-time-difference-between-dates-in-the-same-column/m-p/1608190#M737680</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-07-31T17:47:15Z</dc:date>
    </item>
  </channel>
</rss>

