<?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: Rolling 3 month calculation for Days Sales Outstanding in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129432#M9082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is important that you use the right quote characters for literal strings/constant values and searches which should be single quotes for the former and double quotes for the latter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={"Revenue"},YEAR={'2018'},PERIOD={'&amp;lt;=$(VCurrentMonth)'}&amp;gt;}MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 14.6667px; font-family: Calibri, sans-serif;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;'Revenue'&lt;/STRONG&gt;&lt;/SPAN&gt;},YEAR={'2018'},PERIOD={&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;"&amp;lt;=$(VCurrentMonth)"&lt;/STRONG&gt;&lt;/SPAN&gt;}&amp;gt;}MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 14.6667px; font-family: Calibri, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You are talking about the variable VCurrent month and showing the definition for v_CurrentDate (at least according to your comment) but in your expression you try to use a variable named VCurrentMonth ... is it just some typo?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous three months will not work properly in January and February if you reference YEAR and PERIOD. You should use a (calculated) rolling YEARMONTH field that can be created (if not already there) in your load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could look like this:&amp;nbsp;&amp;nbsp; 201801, 201802, 201803 ....&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate it you could:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR &amp;amp; Num(PERIOD,'00') AS YEARMONTH,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression would look more like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={'Revenue'},YEAR={'2018'},PERIOD={"&amp;gt;$(v3MonthsAgo)&amp;lt;=$(vCurrentMonth)"}&amp;gt;} MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth:&lt;/P&gt;&lt;P&gt;=Date( Today(1) , 'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v3MonthsAgo:&lt;/P&gt;&lt;P&gt;=Date( AddMonths(Today(1),-3) ,'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the average once you get the sum of the previous three months right you can only divide the sum by three of course...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2018 05:27:15 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2018-08-29T05:27:15Z</dc:date>
    <item>
      <title>Rolling 3 month calculation for Days Sales Outstanding</title>
      <link>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129431#M9081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I am looking to calculate rolling average days sales outstanding.&amp;nbsp; The calculation would normally be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; text-decoration: underline; font-family: 'Calibri',sans-serif;"&gt;Avg of previous 3 months AR &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; Avg of previous 3 months Revenue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x 360&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;I am able to the formula to work for a single month but cannot get it to work as a rolling 3 months avg.&amp;nbsp; Below are the scripts that I am using for AR and revenue&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;//formula for Revenue for a single month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={"Revenue"},YEAR={'2018'},PERIOD={'&amp;lt;=$(VCurrentMonth)'}&amp;gt;}MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;//Formula for AR for a single month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;Sum({&amp;lt;[BalanceSheetHeading]={"Accounts Receivable, net"},YEAR={'2018'},PERIOD={'&amp;lt;=$(VCurrentMonth)'}&amp;gt;}MonthlyBalanceAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;also script for the variable VCurrent date is &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=num(Month(today()),'00')&lt;/P&gt;&lt;P&gt;//v_CurrentDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight would be greatly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 19:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129431#M9081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-28T19:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 month calculation for Days Sales Outstanding</title>
      <link>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129432#M9082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is important that you use the right quote characters for literal strings/constant values and searches which should be single quotes for the former and double quotes for the latter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={"Revenue"},YEAR={'2018'},PERIOD={'&amp;lt;=$(VCurrentMonth)'}&amp;gt;}MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 14.6667px; font-family: Calibri, sans-serif;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;'Revenue'&lt;/STRONG&gt;&lt;/SPAN&gt;},YEAR={'2018'},PERIOD={&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;"&amp;lt;=$(VCurrentMonth)"&lt;/STRONG&gt;&lt;/SPAN&gt;}&amp;gt;}MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 14.6667px; font-family: Calibri, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You are talking about the variable VCurrent month and showing the definition for v_CurrentDate (at least according to your comment) but in your expression you try to use a variable named VCurrentMonth ... is it just some typo?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous three months will not work properly in January and February if you reference YEAR and PERIOD. You should use a (calculated) rolling YEARMONTH field that can be created (if not already there) in your load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could look like this:&amp;nbsp;&amp;nbsp; 201801, 201802, 201803 ....&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate it you could:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR &amp;amp; Num(PERIOD,'00') AS YEARMONTH,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression would look more like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={'Revenue'},YEAR={'2018'},PERIOD={"&amp;gt;$(v3MonthsAgo)&amp;lt;=$(vCurrentMonth)"}&amp;gt;} MonthlyPostAMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: Calibri, sans-serif; font-size: 14.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth:&lt;/P&gt;&lt;P&gt;=Date( Today(1) , 'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v3MonthsAgo:&lt;/P&gt;&lt;P&gt;=Date( AddMonths(Today(1),-3) ,'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the average once you get the sum of the previous three months right you can only divide the sum by three of course...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 05:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129432#M9082</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-29T05:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 month calculation for Days Sales Outstanding</title>
      <link>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129433#M9083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For previous 3 months try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;[Exec P&amp;amp;L Heading]={"Revenue"},YEAR={'2018'},PERIOD={"&amp;gt;=$(=MonthStart(AddMonths(Max(PERIOD),-3)))&amp;lt;=$(=MonthEnd(AddMonths(Max(PERIOD),-1)))"}&amp;gt;}MonthlyPostAMT) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;[BalanceSheetHeading]={"Accounts Receivable, net"},YEAR={'2018'},PERIOD={"&amp;gt;=$(=MonthStart(AddMonths(Max(PERIOD),-3)))&amp;lt;=$(=MonthEnd(AddMonths(Max(PERIOD),-1)))"}&amp;gt;}MonthlyBalanceAMT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 06:20:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rolling-3-month-calculation-for-Days-Sales-Outstanding/m-p/129433#M9083</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-08-29T06:20:12Z</dc:date>
    </item>
  </channel>
</rss>

