<?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 Split amount range date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576556#M442579</link>
    <description>&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Hi everyone, I have a problem with the split of costs (expected and end) in the relative range of dates (schedstart and schedfinish).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;My goal is to split the costs on a daily basis and then aggregate them by day, month, semester and year by grouping them by type.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;my goal is the green box in the attached excel file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;Thank's&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Fri, 03 May 2019 20:20:30 GMT</pubDate>
    <dc:creator>Gabri11</dc:creator>
    <dc:date>2019-05-03T20:20:30Z</dc:date>
    <item>
      <title>Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576556#M442579</link>
      <description>&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Hi everyone, I have a problem with the split of costs (expected and end) in the relative range of dates (schedstart and schedfinish).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;My goal is to split the costs on a daily basis and then aggregate them by day, month, semester and year by grouping them by type.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;my goal is the green box in the attached excel file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="tlid-translation translation"&gt;Thank's&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 May 2019 20:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576556#M442579</guid>
      <dc:creator>Gabri11</dc:creator>
      <dc:date>2019-05-03T20:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576644#M442588</link>
      <description>Hi,l assuming that all months gets the same amount it can be something like:&lt;BR /&gt;data:&lt;BR /&gt;LOAD *,&lt;BR /&gt;expected/numMonths as expectedByMonth,&lt;BR /&gt;addMonths(schedstart,IterNo()-1) as referenceDate&lt;BR /&gt;While numMonths&amp;gt;=IterNo();&lt;BR /&gt;LOAD wo,&lt;BR /&gt;expected,&lt;BR /&gt;final,&lt;BR /&gt;type,&lt;BR /&gt;schedstart,&lt;BR /&gt;schedfinish,&lt;BR /&gt;((Year(schedfinish)*12)+Month(schedfinish)) - ((Year(schedstart)*12)+Month(schedstart)) + 1 as numMonths&lt;BR /&gt;FROM&lt;BR /&gt;[.\cost.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is cost);&lt;BR /&gt;&lt;BR /&gt;From referenceDate you can get year and month, and expectedByMonth will be the amount of that month.</description>
      <pubDate>Sun, 05 May 2019 10:56:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576644#M442588</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-05-05T10:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576746#M442602</link>
      <description>&lt;P&gt;hello, it seems to work correctly but I need to split by day and not by month (the referencedate must be on a daily basis).&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 06:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1576746#M442602</guid>
      <dc:creator>Gabri11</dc:creator>
      <dc:date>2019-05-06T06:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577230#M442616</link>
      <description>&lt;P&gt;Hi, are you sure of the daily basis? in example a cost from 31/03 to 30/04, maybe it's a 2-month payment is done at end of the month and it will be 50/50 between months, if it's on daily basis march will get only 1/31 and april the others 30/31.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 08:10:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577230#M442616</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-05-07T08:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577299#M442622</link>
      <description>&lt;P&gt;Yes. I need to split the costs on a daily basis and group them by month / quarter. therefore if a cost goes from 30/03 to 15/05, the costs will be split for 1 day in March, 30 in April and 15 in May.&lt;BR /&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 10:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577299#M442622</guid>
      <dc:creator>Gabri11</dc:creator>
      <dc:date>2019-05-07T10:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Split amount range date</title>
      <link>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577568#M442658</link>
      <description>&lt;P&gt;Probably it will need some debug but can be something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data:
LOAD
  *,
  expected*(daysMonth/totalDays) as expectedByMonth_DayBase
;
LOAD
  *,
  //start and finish in the same month
  If(MonthName(schedfinish)=MonthName(schedstart)
    ,schedfinish-schedstart
    //count of the first month
    ,If(MonthName(referenceDate)=MonthName(schedstart)
      ,Floor(MonthEnd(schedstart))-schedstart+1
      // count of the last month
      ,If(MonthName(referenceDate)=MonthName(schedfinish)
        ,schedfinish-MonthStart(schedfinish)+1
        // full months
        ,Floor(MonthEnd(referenceDate))-MonthStart(referenceDate)+1
   ))) as daysMonth,
   schedfinish-schedstart as totalDays
;
LOAD 
  *,
  expected/numMonths as expectedByMonth,
  addMonths(schedstart,IterNo()-1) as referenceDate
While numMonths&amp;gt;=IterNo();
LOAD 
  wo,
  expected,
  final,
  type,
  schedstart,
  schedfinish,
  ((Year(schedfinish)*12)+Month(schedfinish)) - ((Year(schedstart)*12)+Month(schedstart)) + 1 as numMonths
FROM
[.\cost.xlsx]
(ooxml, embedded labels, table is cost);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 16:18:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Split-amount-range-date/m-p/1577568#M442658</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-05-07T16:18:58Z</dc:date>
    </item>
  </channel>
</rss>

