<?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: Derive previous billing dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088398#M362212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!&amp;nbsp; works perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2016 14:11:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-26T14:11:24Z</dc:date>
    <item>
      <title>Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088392#M362206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Pulled dates from&amp;nbsp; Fact table&amp;nbsp; grouped by customer, material &amp;amp; billing date.&lt;/P&gt;&lt;P&gt;Need to find out the days between orders ,for which&amp;nbsp; previous billing dates&amp;nbsp; ( like below) are required.&lt;/P&gt;&lt;P&gt;How do we derive the previous billing dates at script level?&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/122459_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088392#M362206</guid>
      <dc:creator />
      <dc:date>2016-04-22T15:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088393#M362207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use Peek or Previous functions&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9314"&gt;Peek() or Previous() ?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4073"&gt;Peek() vs Previous() – When to Use Each&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088393#M362207</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-22T15:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088394#M362208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Date&lt;/P&gt;&lt;P&gt;FROM table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new:&lt;/P&gt;&lt;P&gt;noconcatenate&lt;/P&gt;&lt;P&gt;LOAD *,&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(&lt;SPAN style="font-size: 13.3333px;"&gt;Billing_Date&amp;lt;&amp;gt;previous(&lt;SPAN style="font-size: 13.3333px;"&gt;Billing_Date&lt;/SPAN&gt;),&lt;SPAN style="font-size: 13.3333px;"&gt;previous(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Billing_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;),0) as PrevBillingDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident Data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;order by &lt;SPAN style="font-size: 13.3333px;"&gt;Billing_Date asc;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088394#M362208</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-04-22T15:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088395#M362209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help. I am trying to derive&amp;nbsp; standard deviation.:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; average days of sales would be the diff between the last and first day of sale divided by&amp;nbsp; number of sales.&lt;/P&gt;&lt;P&gt;2. The days between sales is needed to calculate the standard deviation or to use the Stdev function.&lt;/P&gt;&lt;P&gt;I am still not able to get days between&amp;nbsp; sales as the previous(Billing_date ) is not&amp;nbsp; working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 13:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088395#M362209</guid>
      <dc:creator />
      <dc:date>2016-04-25T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088396#M362210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you able to share the sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 11:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088396#M362210</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-04-26T11:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088397#M362211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Rajashree Reddy wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your help. I am trying to derive&amp;nbsp; standard deviation.:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; average days of sales would be the diff between the last and first day of sale divided by&amp;nbsp; number of sales.&lt;/P&gt;
&lt;P&gt;2. The days between sales is needed to calculate the standard deviation or to use the Stdev function.&lt;/P&gt;
&lt;P&gt;I am still not able to get days between&amp;nbsp; sales as the previous(Billing_date ) is not&amp;nbsp; working.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;
&lt;P&gt;Could you please help.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;
&lt;P&gt;Thanks !&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;w.r.t 1), I think you should divide by (number of sales -1) to get the avg number of days between sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w.r.t. 2): Seems to work for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14616735777082337" jivemacro_uid="_14616735777082337"&gt;
&lt;P&gt;SET DateFormat='D-M-YYYY';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; alt(Peek('Billing_Date'),0) as PrevBillingDate1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; alt(Previous(Date#(Billing_Date)),0) as PrevBillingDate2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Billing_Date - Previous(Billing_Date) as BillingDateDiff&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;Billing_Date&lt;/P&gt;
&lt;P&gt;1-4-2016&lt;/P&gt;
&lt;P&gt;10-4-2016&lt;/P&gt;
&lt;P&gt;22-4-2016&lt;/P&gt;
&lt;P&gt;26-4-2016&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can calculate the avg days of sales like &lt;/P&gt;&lt;P&gt;=Avg(BillingDateDiff)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[returns 8.33]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the standard deviation like&lt;/P&gt;&lt;P&gt;=Stdev(BillingDateDiff)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[returns 4.04]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Billing_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;PrevBillingDate1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;PrevBillingDate2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;BillingDateDiff&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;10-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;9&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;10-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;10-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;12&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22-4-2016&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 12:28:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088397#M362211</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-26T12:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088398#M362212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!&amp;nbsp; works perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 14:11:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088398#M362212</guid>
      <dc:creator />
      <dc:date>2016-04-26T14:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Derive previous billing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088399#M362213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your request is resolved, please consider closing this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 16:28:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-previous-billing-dates/m-p/1088399#M362213</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-26T16:28:22Z</dc:date>
    </item>
  </channel>
</rss>

