<?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 Claculating Days between dates then getting Average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340386#M576693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sean,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every document you have a Clearing date and an Invoice date, so that works fine.&lt;/P&gt;&lt;P&gt;When you drop your Document you have multiple Clearing and invoice dates, so it makes sense to me that you can not use the same expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easies solution is to calculate the difference for every document in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load ..&lt;/P&gt;&lt;P&gt;ClearingDate,&lt;/P&gt;&lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;(ClearingDate-Date)&amp;nbsp; as DaysToPay,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;From ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you have the days to pay for all your documents which makes it a lot easier to work with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Dennis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Apr 2012 11:36:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-04-06T11:36:56Z</dc:date>
    <item>
      <title>Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340381#M576688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I have 2 sheet objects, 1 summary and 1 detail showing the difference between a billing date and when it was paid.&amp;nbsp;&amp;nbsp; On the detail sheet, I am calculating the difference between 2 dates like this, (ClearingDate - Date) and it works, and I am getting the average like this, Avg(ClearingDate - Date) and it works.&amp;nbsp; On the summary sheet, let's assume there are 10 invoices, the difference in days in calculated the same as above and it works, however trying to get the average the same way I am not getting the correct number, it is off by several days.&amp;nbsp; Any suggestion on how I should calculate the average when summarizing multiple customer invoices?&amp;nbsp; Thanks,&amp;nbsp; &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 21:07:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340381#M576688</guid>
      <dc:creator />
      <dc:date>2012-04-05T21:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340382#M576689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell us a bit more about your setting (data model, chart objects - dimensions and expressions)? Best would be to post a small sample that demonstrates your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your details sheet object (straight table?), I assume you are showing the details on invoice level (1 invoice per row), and 1 invoice has 1 ClearingDate and 1 Date. Thus you can use (ClearingDate-Date) and you get an unambiguous answer. But calculating the average should give the identical result then? This I don't understand yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your summary sheet object, if you aggregate over several invoices, (ClearingDate-Date) shouldn't return an unambiguous result (unless the difference is the same for all invoices), I believe you would need to use some aggregation here (like an average). It seems you don't, so I am probably way off in my assumptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 22:36:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340382#M576689</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-04-05T22:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340383#M576690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I have attached an example of the out put for both sheet objects.&amp;nbsp; Both are charts, straight tables. Thanks for assisting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sean Smith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 22:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340383#M576690</guid>
      <dc:creator />
      <dc:date>2012-04-05T22:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340384#M576691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why dont you work out the difference between your dates in your lkoading script then you just need to average them out in your table box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 22:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340384#M576691</guid>
      <dc:creator />
      <dc:date>2012-04-05T22:56:56Z</dc:date>
    </item>
    <item>
      <title>Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340385#M576692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sean, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I use the data from your output sample as input, I get the same result for detail as for summary when using avg(ClearingDate-Date), i.e. 26.6 days. So I believe the issue is due to something that is hidden in your data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you upload you app or your input data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2012 23:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340385#M576692</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-04-05T23:20:34Z</dc:date>
    </item>
    <item>
      <title>Claculating Days between dates then getting Average</title>
      <link>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340386#M576693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sean,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every document you have a Clearing date and an Invoice date, so that works fine.&lt;/P&gt;&lt;P&gt;When you drop your Document you have multiple Clearing and invoice dates, so it makes sense to me that you can not use the same expresion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easies solution is to calculate the difference for every document in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load ..&lt;/P&gt;&lt;P&gt;ClearingDate,&lt;/P&gt;&lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;(ClearingDate-Date)&amp;nbsp; as DaysToPay,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;From ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you have the days to pay for all your documents which makes it a lot easier to work with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Dennis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 11:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Claculating-Days-between-dates-then-getting-Average/m-p/340386#M576693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-06T11:36:56Z</dc:date>
    </item>
  </channel>
</rss>

