<?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 Calculating Range from Visit to Order in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424660#M158176</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;&lt;SPAN style="font-size: 10pt;"&gt;I would like to get following calculated informations out of the table below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Visits till first order (4 visits)&lt;/P&gt;&lt;P&gt;Time since first visit till first order ( 3days 1hour) 13.01.01 13:18:00 - &lt;SPAN style="font-size: 10pt;"&gt;10.01.01&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; 12:12:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Visits since last order till next order (3 visits)&lt;/P&gt;&lt;P&gt;Time since first visit after last order till next order (2days 6min 1sec)&amp;nbsp; 18.01.01 13:19:11 - 16.01.01 13:13:10&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should go on in a loop.&lt;/P&gt;&lt;P&gt;If after the last visit no order-timestamp exists the script should count till today().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;timestamp= dd.mm.yy hh:mm:ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer:&lt;/P&gt;&lt;P&gt;johndoe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;visits&lt;SPAN style="font-size: 10pt;"&gt;(timestamp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;10.01.01&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; 12:12:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;11.01.01 12:12:11&lt;/P&gt;&lt;P&gt;12.01.01 12:12:12&lt;/P&gt;&lt;P&gt;13.01.01 12:12:13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16.01.01 13:13:10 &lt;/P&gt;&lt;P&gt;17.01.01 13:13:12&lt;/P&gt;&lt;P&gt;18.01.01 13:13:11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19.01. 12:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;orders(timestamp)&lt;/P&gt;&lt;P&gt;13.01.01 13:18:00&lt;/P&gt;&lt;P&gt;18.01.01 13:19:11&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2013 21:54:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-04-04T21:54:26Z</dc:date>
    <item>
      <title>Calculating Range from Visit to Order</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424660#M158176</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;&lt;SPAN style="font-size: 10pt;"&gt;I would like to get following calculated informations out of the table below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Visits till first order (4 visits)&lt;/P&gt;&lt;P&gt;Time since first visit till first order ( 3days 1hour) 13.01.01 13:18:00 - &lt;SPAN style="font-size: 10pt;"&gt;10.01.01&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; 12:12:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Visits since last order till next order (3 visits)&lt;/P&gt;&lt;P&gt;Time since first visit after last order till next order (2days 6min 1sec)&amp;nbsp; 18.01.01 13:19:11 - 16.01.01 13:13:10&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should go on in a loop.&lt;/P&gt;&lt;P&gt;If after the last visit no order-timestamp exists the script should count till today().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;timestamp= dd.mm.yy hh:mm:ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer:&lt;/P&gt;&lt;P&gt;johndoe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;visits&lt;SPAN style="font-size: 10pt;"&gt;(timestamp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;10.01.01&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; 12:12:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;11.01.01 12:12:11&lt;/P&gt;&lt;P&gt;12.01.01 12:12:12&lt;/P&gt;&lt;P&gt;13.01.01 12:12:13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16.01.01 13:13:10 &lt;/P&gt;&lt;P&gt;17.01.01 13:13:12&lt;/P&gt;&lt;P&gt;18.01.01 13:13:11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19.01. 12:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;orders(timestamp)&lt;/P&gt;&lt;P&gt;13.01.01 13:18:00&lt;/P&gt;&lt;P&gt;18.01.01 13:19:11&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 21:54:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424660#M158176</guid>
      <dc:creator />
      <dc:date>2013-04-04T21:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Range from Visit to Order</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424661#M158177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like attached? Using this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TS:&lt;/P&gt;&lt;P&gt;LOAD TS, 'Orders' as Type INLINE [&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;P&gt;13.01.01 13:18:00&lt;/P&gt;&lt;P&gt;18.01.01 13:19:11&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vNumOrders = NoOfRows('TS'); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD TS, 'Visits' as Type INLINE [&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;P&gt;10.01.01 12:12:00&lt;/P&gt;&lt;P&gt;11.01.01 12:12:11&lt;/P&gt;&lt;P&gt;12.01.01 12:12:12&lt;/P&gt;&lt;P&gt;13.01.01 12:12:13&lt;/P&gt;&lt;P&gt; 16.01.01 13:13:10&lt;/P&gt;&lt;P&gt;17.01.01 13:13:12&lt;/P&gt;&lt;P&gt;18.01.01 13:13:11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;19.01.01 12:00:00&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TMP:&lt;/P&gt;&lt;P&gt;LOAD *, if(Type= 'Visits', AutoNumber(TS, OrderNum) ) as VisitNum;&lt;/P&gt;&lt;P&gt;LOAD TS, Type, if(recno() = 1,$(vNumOrders)+1, peek(OrderNum) - if(Type='Orders',1,0)) as OrderNum &lt;/P&gt;&lt;P&gt;Resident TS order by TS desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table TS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result: &lt;/P&gt;&lt;P&gt;LOAD OrderNum, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max(VisitNum) as DeltaVisits, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;interval(if(LastValue(Type) &amp;lt;&amp;gt; 'Orders', now(), LastValue(TS)) - FirstValue(TS),'dd&amp;nbsp; hh:mm:ss' )&amp;nbsp;&amp;nbsp; as DeltaTime ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(LastValue(Type) &amp;lt;&amp;gt; 'Orders', true() , false() ) as OrderPending&lt;/P&gt;&lt;P&gt;Resident TMP group by OrderNum order by TS asc;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 22:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424661#M158177</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-04-04T22:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Range from Visit to Order</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424662#M158178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You verry much for this solution and sorry for the late response!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 07:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Range-from-Visit-to-Order/m-p/424662#M158178</guid>
      <dc:creator />
      <dc:date>2013-04-29T07:47:49Z</dc:date>
    </item>
  </channel>
</rss>

