<?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: Measure spanning multiple days/months in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1833896#M68847</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Since the basis for the calculation does not appear to vary based on the selections made in the app, it would be more efficient to handle this in the load script. You can then directly reference the field in your visualizations.</description>
    <pubDate>Mon, 06 Sep 2021 08:28:41 GMT</pubDate>
    <dc:creator>rbartley</dc:creator>
    <dc:date>2021-09-06T08:28:41Z</dc:date>
    <item>
      <title>Measure spanning multiple days/months</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1833763#M68835</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have an app I am working on that it tracking shipments. We need to calculate the average inventory in transit per month. So if a shipment had a departure date of 1/1 and arrival of 1/10 and the value of the inventory was $1000, the average value for the month would be $333 ($1000 per day, 10 days out of 30 days in the month). This can get tricky as some shipments will be in transit for multiple months. What I tried to do was create a table of dates for every day in between earliest departure date and the latest arrival date (field called InventoryDate). Then I wrote this measure:&lt;/P&gt;&lt;P&gt;Sum(If(Date(InventoryDate) &amp;gt;= Date(Departure_Date) and Date(InventoryDate) &amp;lt; Date(Arrival_Date),[Shipment value]))/30&lt;/P&gt;&lt;P&gt;It kind of works, but it is not great and I am struggling to make similiar measures (like average shipment volume).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a thought on how to handle this better?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 21:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1833763#M68835</guid>
      <dc:creator>keithboruta</dc:creator>
      <dc:date>2021-09-03T21:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Measure spanning multiple days/months</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1833896#M68847</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Since the basis for the calculation does not appear to vary based on the selections made in the app, it would be more efficient to handle this in the load script. You can then directly reference the field in your visualizations.</description>
      <pubDate>Mon, 06 Sep 2021 08:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1833896#M68847</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2021-09-06T08:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Measure spanning multiple days/months</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1834318#M68880</link>
      <description>&lt;P&gt;Thanks Rbartley!&lt;/P&gt;&lt;P&gt;How would I do that? I am a bit unsure how to do that in a load script as I would need to calculate the daily value from one table as store it off in another table.&lt;/P&gt;&lt;P&gt;Or something else?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 11:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-spanning-multiple-days-months/m-p/1834318#M68880</guid>
      <dc:creator>keithboruta</dc:creator>
      <dc:date>2021-09-07T11:56:52Z</dc:date>
    </item>
  </channel>
</rss>

