<?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: Interval Time diffrences with Criteria in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104300#M906182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your script needed improvement, I still don't understand the full requirement but this below script calculates the time difference of sentdate between difference task id - &lt;/P&gt;&lt;P&gt;Task:&lt;/P&gt;&lt;P&gt;LOAD RootTaskID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; originaltaskid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecipientID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sentdate as SentDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StatusID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Example.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Task2:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp; TaskID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; RootTaskID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SentDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Previous(TaskID)&amp;lt;&amp;gt;TaskID and Previous(RootTaskID)=RootTaskID,Interval(SentDate-Peek(SentDate),'hh:mm:ss'),Null()) as ResponseTime&lt;/P&gt;&lt;P&gt;Resident Task&lt;/P&gt;&lt;P&gt;Order By RootTaskID,SentDate;&lt;/P&gt;&lt;P&gt;Drop table Task;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain the logic of initialFlag?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2016 05:14:55 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2016-06-24T05:14:55Z</dc:date>
    <item>
      <title>Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104296#M906178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to determine time differences between sent dates and flag the earliest time difference for a "root task". The difference between the first two sent dates, that meet the criteria would be the initial response time, I would also want to sum all differences to get a total time for a "root task".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have included a snippet of the table structure below: I would want to get the difference of the sent dates for TaskID 5868632 and 58817076 for the initial response time. I would want to then sum all other differences in sent date where TaskID are different. I would then want to group by RootTaskID&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="129004" alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/129004_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;I have tried several different ways to get this with Peek and Previous. Currently I am using the code below, but the flag is not identifying correctly and I am not getting the time differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there have been several post regarding this topic, but I have not sound one that I have been able to leverage. Thank you for your help in advance!&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="129014" alt="" class="jive-image image-2" height="273" src="https://community.qlik.com/legacyfs/online/129014_pastedImage_1.png" style="width: 1409.88px; height: 273px;" width="1410" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104296#M906178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104297#M906179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you attach excel or smthg with sample data, I think the image shared cannot be used directly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 16:52:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104297#M906179</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-06-23T16:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104298#M906180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure here ya go. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 17:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104298#M906180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-23T17:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104299#M906181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For one task id you have several sentdate, which one you need to choose to compare(get difference) it with other task id's sent date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 04:43:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104299#M906181</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-06-24T04:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104300#M906182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your script needed improvement, I still don't understand the full requirement but this below script calculates the time difference of sentdate between difference task id - &lt;/P&gt;&lt;P&gt;Task:&lt;/P&gt;&lt;P&gt;LOAD RootTaskID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; originaltaskid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecipientID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sentdate as SentDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StatusID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Example.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Task2:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp; TaskID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; RootTaskID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SentDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Previous(TaskID)&amp;lt;&amp;gt;TaskID and Previous(RootTaskID)=RootTaskID,Interval(SentDate-Peek(SentDate),'hh:mm:ss'),Null()) as ResponseTime&lt;/P&gt;&lt;P&gt;Resident Task&lt;/P&gt;&lt;P&gt;Order By RootTaskID,SentDate;&lt;/P&gt;&lt;P&gt;Drop table Task;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain the logic of initialFlag?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:14:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104300#M906182</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-06-24T05:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104301#M906183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please try this one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Task:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD RootTaskID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; originaltaskid,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecipientID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sentdate as SentDate,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StatusID&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Example.xlsx&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Task2:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; TaskID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; RootTaskID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; SentDate,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; If(Previous(TaskID)&amp;lt;&amp;gt;TaskID and Previous(RootTaskID)=RootTaskID,Interval(SentDate-Peek(SentDate),' D hh:mm:ss'),Null()) as ResponseTime&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Task&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Order By RootTaskID,SentDate;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Drop table Task;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104301#M906183</guid>
      <dc:creator>maniram23</dc:creator>
      <dc:date>2016-06-24T05:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Time diffrences with Criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104302#M906184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DJ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data was structured in a less than optimal way, so it makes things a little more complicated than it should be. It may help to think of the data this way- A roottask is a string of questions and responses about an incident. Each taskid is a different communication from a sender. The first sentdate in chronological order would be the initial question, the second sentdate would be the response to that question. The second sentdate would have to have a different taskid, but have the same roottask. I want to get the time difference here to see how long it takes to respond. There are multiple identical taskids because there are group sends. The last time diffrence I would want to get is the difference from the first sentdate to last sentdate, how long a roottask takes to close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully that was not too confusing. Thank you for the help with this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 14:30:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Time-diffrences-with-Criteria/m-p/1104302#M906184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-24T14:30:59Z</dc:date>
    </item>
  </channel>
</rss>

