<?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: Duration from First Occurence in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342066#M514624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this works how you want it to (it returns 49 for me, and the FirstSortedValue will take into consideration any status that is selected):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg(Aggr(if(max(DEFECT_STATUS_START_DATE)-min(DEFECT_STATUS_START_DATE)&amp;gt;1,(SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Min({&amp;lt;DEFECT_STATUS-={'$(=FirstSortedValue(DEFECT_STATUS, DEFECT_STATUS_START_DATE))'}&amp;gt;}DEFECT_STATUS_START_DATE)&lt;/STRONG&gt;&lt;/SPAN&gt; - Min(DEFECT_STATUS_START_DATE)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,DEFECT_ID)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;/Count({$&amp;lt;DEFECT_ID = {"=Count(DEFECT_STATUS_MAP) = GetSelectedCount(DEFECT_STATUS_MAP)"}&amp;gt;}DISTINCT DEFECT_ID))),FISCAL_YEAR, DEFECT_ID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jul 2017 20:03:55 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2017-07-06T20:03:55Z</dc:date>
    <item>
      <title>Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342062#M514620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select DEFECT_ID = 1073 and Statuses of New and Approved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this defect, the start date for new is 9/23/13 and there are two instances of Approved... one with a start date of 11/11/2013 and one with 11/25/13.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now the expression is showing me 63 days which is 11/25/13-9/23/13.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_STATUS_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_STATUS_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;1,(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_STATUS_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)- &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_STATUS_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt; ,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt; )&lt;BR /&gt; &lt;BR /&gt; /&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=Count(DEFECT_STATUS_MAP) = GetSelectedCount(DEFECT_STATUS_MAP)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FISCAL_YEAR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DEFECT_ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I only want the &lt;STRONG&gt;first occurrence&lt;/STRONG&gt; of whichever Statuses (DEFECT_STATUS_MAP) are selected. In this example, I would want to see 49 days which is 11/11/2013-9/23/13.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;TIA!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342062#M514620</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2017-07-06T18:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342063#M514621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr(if(max(DEFECT_STATUS_START_DATE)-min(DEFECT_STATUS_START_DATE)&amp;gt;1,(SUM(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Min(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;DEFECT_STATUS = {'Approved'}&amp;gt;}&lt;/SPAN&gt; DEFECT_STATUS_START_DATE)- Min(DEFECT_STATUS_START_DATE)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ,DEFECT_ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/Count({$&amp;lt;DEFECT_ID = {"=Count(DEFECT_STATUS_MAP) = GetSelectedCount(DEFECT_STATUS_MAP)"}&amp;gt;}DISTINCT DEFECT_ID))),FISCAL_YEAR, DEFECT_ID))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342063#M514621</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-06T18:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342064#M514622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't hardcode the status because it should apply to both selected statuses and the user can pick any 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:23:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342064#M514622</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2017-07-06T19:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342065#M514623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I am completely understanding what you need here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:29:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342065#M514623</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-06T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342066#M514624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this works how you want it to (it returns 49 for me, and the FirstSortedValue will take into consideration any status that is selected):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg(Aggr(if(max(DEFECT_STATUS_START_DATE)-min(DEFECT_STATUS_START_DATE)&amp;gt;1,(SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Min({&amp;lt;DEFECT_STATUS-={'$(=FirstSortedValue(DEFECT_STATUS, DEFECT_STATUS_START_DATE))'}&amp;gt;}DEFECT_STATUS_START_DATE)&lt;/STRONG&gt;&lt;/SPAN&gt; - Min(DEFECT_STATUS_START_DATE)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,DEFECT_ID)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;/Count({$&amp;lt;DEFECT_ID = {"=Count(DEFECT_STATUS_MAP) = GetSelectedCount(DEFECT_STATUS_MAP)"}&amp;gt;}DISTINCT DEFECT_ID))),FISCAL_YEAR, DEFECT_ID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:03:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342066#M514624</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2017-07-06T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Duration from First Occurence</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342067#M514625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-from-First-Occurence/m-p/1342067#M514625</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2017-07-06T20:26:30Z</dc:date>
    </item>
  </channel>
</rss>

