<?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: Problem with se analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438923#M163597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure datacos and datamov are real dates and not strings. Use the date# function if necessary (preferably in the load script). If your dateformat is 'DD/MM/YYYY' you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg({$&amp;lt;datacos={"&amp;gt;=$(=date#(datamov),'DD/MM/YYYY')-10)&amp;lt;=$(=date#(datamov),'DD/MM/YYYY')"}&amp;gt;}goods_costs)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2012 12:23:41 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-10-22T12:23:41Z</dc:date>
    <item>
      <title>Problem with se analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438922#M163596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning to everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two tables one with sales and one with goods cost.&lt;/P&gt;&lt;P&gt;Every sale is connected with every goods purchase of the year using article code.&lt;/P&gt;&lt;P&gt;For every sale i need to calculate an average cost calculated from date of sell -10 days to date of sell (if there aren't purchase in this period i have to consider the first purchase before the date of sell -10).&lt;/P&gt;&lt;P&gt;datamov--&amp;gt;date of sell&lt;BR /&gt;datacos--&amp;gt;date of purchase.&lt;/P&gt;&lt;P&gt;I use this expression:&lt;BR /&gt;Avg({$&amp;lt;datacos={"&amp;gt;=$(=date(datamov-10)) &amp;lt;=$(=date(datamov))"}&amp;gt;}goods_costs)&lt;/P&gt;&lt;P&gt;but costs are calculated on the entire year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 12:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438922#M163596</guid>
      <dc:creator />
      <dc:date>2012-10-22T12:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with se analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438923#M163597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure datacos and datamov are real dates and not strings. Use the date# function if necessary (preferably in the load script). If your dateformat is 'DD/MM/YYYY' you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg({$&amp;lt;datacos={"&amp;gt;=$(=date#(datamov),'DD/MM/YYYY')-10)&amp;lt;=$(=date#(datamov),'DD/MM/YYYY')"}&amp;gt;}goods_costs)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 12:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438923#M163597</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-10-22T12:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with se analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438924#M163598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert but datamov and datacos are both real dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now expression work but only if a datamov is selected otherwise value is null.&lt;/P&gt;&lt;P&gt;Avg({$&amp;lt;datacos={"&amp;gt;=$(=date(datamov-10)) &amp;lt;=$(=date(datamov))"}&amp;gt;} goods_costs)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 13:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-se-analysis/m-p/438924#M163598</guid>
      <dc:creator />
      <dc:date>2012-10-22T13:57:37Z</dc:date>
    </item>
  </channel>
</rss>

