<?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 Assign calculated values per month between 2 dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564541#M441570</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a sample QVW attached to this post with a simple table (as shown in below screenshot). I am trying to create a logic where I would have to divide the "Hrs" equally among the months between the Start &amp;amp; End Date (As shown in next screenshot). Anybody has an idea how I can do it at script level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data in QVW" style="width: 182px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9375i99A7BBBD420048D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="CapacityData.PNG" alt="Data in QVW" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data in QVW&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Desired Calculation" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9376iE2B41C729E7EB82A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capacity.PNG" alt="Desired Calculation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Desired Calculation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:58:02 GMT</pubDate>
    <dc:creator>divya_anand</dc:creator>
    <dc:date>2024-11-16T03:58:02Z</dc:date>
    <item>
      <title>Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564541#M441570</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a sample QVW attached to this post with a simple table (as shown in below screenshot). I am trying to create a logic where I would have to divide the "Hrs" equally among the months between the Start &amp;amp; End Date (As shown in next screenshot). Anybody has an idea how I can do it at script level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data in QVW" style="width: 182px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9375i99A7BBBD420048D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="CapacityData.PNG" alt="Data in QVW" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data in QVW&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Desired Calculation" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9376iE2B41C729E7EB82A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capacity.PNG" alt="Desired Calculation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Desired Calculation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:58:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564541#M441570</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2024-11-16T03:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564552#M441572</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/754"&gt;@divya_anand&lt;/a&gt;&amp;nbsp;Don't see the qvw attached. Can you check and attach it again&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 12:42:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564552#M441572</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-03T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564871#M441593</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I've attached the file now.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 03:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564871#M441593</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T03:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564873#M441594</link>
      <description>What du you mean by equally?&lt;BR /&gt;Imagine you have 150 hours to divide between the dates 31/3/2019 and 2/4/2019. How many hours would you like to see assigned to March 2019? Is it 50 or 75 hours?</description>
      <pubDate>Thu, 04 Apr 2019 04:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564873#M441594</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-04T04:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564876#M441596</link>
      <description>Hi,&lt;BR /&gt;The start date &amp;amp; end date is always going to be 1st of the month as in the screenshots attached above. So, considering your example to be 3/1/2019 (M/D/YYYY) &amp;amp; 4/1/2019, we have 2 months between these start &amp;amp; end dates (inclusive). Hence, divide the Hrs (150) by 2 = 75. So, Mar will be assigned 75 &amp;amp; Apr =75.&lt;BR /&gt;Is this clear?</description>
      <pubDate>Thu, 04 Apr 2019 04:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564876#M441596</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T04:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564880#M441597</link>
      <description>Very clear, I assumed another date format D/M/YYYY which gave me 1 day in March and 2 days in April.</description>
      <pubDate>Thu, 04 Apr 2019 04:45:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564880#M441597</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-04T04:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564883#M441598</link>
      <description>So, any ideas?</description>
      <pubDate>Thu, 04 Apr 2019 05:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564883#M441598</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T05:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564885#M441599</link>
      <description>&lt;BR /&gt;I would probably do an left join intervalmatch against a table listing all possible months.&lt;BR /&gt;Then&lt;BR /&gt;Left join count(month), project&lt;BR /&gt;Resident Table&lt;BR /&gt;Group by project;&lt;BR /&gt;&lt;BR /&gt;At last do a calculation where you divide the hours with the count.&lt;BR /&gt;&lt;BR /&gt;(I hope you get something from this description, I'm typing on my mobile)</description>
      <pubDate>Thu, 04 Apr 2019 05:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564885#M441599</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-04T05:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564921#M441601</link>
      <description>&lt;P&gt;This worked. Thank you very much.&lt;/P&gt;&lt;P&gt;I have another challenge, attaching the working QVW below.&lt;/P&gt;&lt;P&gt;Instead of assigning equally (Hrs/No of months), Is it possible to assign 60% hrs to 1st 33% months, 25% to next 33% months &amp;amp; remaining 15% hrs to the remaining 33% months?&lt;/P&gt;&lt;P&gt;For eg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hrs=192;&lt;/P&gt;&lt;P&gt;Start Date: 6/1/2018;&lt;/P&gt;&lt;P&gt;End Date: 6/1/2019;&lt;/P&gt;&lt;P&gt;Hence No. of Months=13&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;13(No. of Months) divided by 3 (always a standard, 3 phases)= 4.33, floor(4.33)= 4&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hence 4 months in each phase.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Assign 60% of 192 (Hrs) = 115.2 to 1st 4 months (2018 Jun=115.2/4= 28.8, Jul=28.8, Aug=28.8, Sep=28.8)&lt;/P&gt;&lt;P&gt;25% of 192 = 48 to next 4 months (2018 Oct=48/4=12, Nov=12, Dec=12, 2019 Jan=12)&lt;/P&gt;&lt;P&gt;15% of 192 = 28.8 to last 4 months(2019 Feb= 28.8/4=7.2, Mar=7.2, Apr=7.2, May=7.2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on this, if an idea strikes your mind, please give me a hint. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 06:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1564921#M441601</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T06:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565055#M441618</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Any idea on the above post?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 10:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565055#M441618</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T10:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565092#M441621</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/754"&gt;@divya_anand&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Start Date: 6/1/2018;&lt;/P&gt;&lt;P&gt;End Date: 6/1/2019;&lt;/P&gt;&lt;P&gt;Hence No. of Months=13&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How is no of months = 13 here? From a date in 2018 to the same date in 2019, shouldn't it be just 12 months flat? I am confused?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 11:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565092#M441621</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-04T11:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565097#M441624</link>
      <description>Hi Sunny,&lt;BR /&gt;it is inclusive of both 2018-Jun &amp;amp; 2019-Jun.</description>
      <pubDate>Thu, 04 Apr 2019 11:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565097#M441624</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T11:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565107#M441625</link>
      <description>&lt;P&gt;Would you be able to give another example... I guess for project B to show how that one will play out?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 11:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565107#M441625</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-04T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565126#M441626</link>
      <description>Sure, So with Project B we have&lt;BR /&gt;Hrs=1683&lt;BR /&gt;Start: 3/1/2018&lt;BR /&gt;End: 7/1/2019&lt;BR /&gt;Hence, no of months = 17&lt;BR /&gt;&lt;BR /&gt;17(No. of Months) divided by 3 (always a standard, 3 phases)= 5.66, floor(5.66)= 5&lt;BR /&gt;&lt;BR /&gt;Hence 5 months in each phase. 5 months for 3 phases is going to sum up to 15 only (not 17), but it's ok.&lt;BR /&gt;&lt;BR /&gt;Assign 60% of 1683 (Hrs) = 1009.8 to 1st 5 months (2018 Mar=1009.8/5= 201.96, Apr=201.96, May=201.96, Jun=201.96, Jul=201.96)&lt;BR /&gt;&lt;BR /&gt;25% of 1683 = 420.75 to next 5 months (2018 Aug=420.75/5=84.15, Sep=84.15, Oct=84.15, Nov=84.15, Dec=84.15 )&lt;BR /&gt;&lt;BR /&gt;15% of 1683 = 252.45 to last 5 months(2019 Jan= 252.45/5=50.49, Feb= 50.49 , Mar=50.49, Apr=50.49, May=50.49)&lt;BR /&gt;&lt;BR /&gt;is it clear?</description>
      <pubDate>Thu, 04 Apr 2019 11:55:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565126#M441626</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T11:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565128#M441627</link>
      <description>&lt;P&gt;Yes ma'am&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;Left Join(Data)
Load Project,
	 %DATE_KEY,
	 If(MonthStart(Start, Floor(Only(MonthsDiff)/3)) &amp;gt; %DATE_KEY, Only(Hrs) * 0.60,
	 	If(MonthStart(Start, Floor(Only(MonthsDiff)/3)*2) &amp;gt; %DATE_KEY, Only(Hrs) * 0.25, Only(Hrs) * 0.15))/Floor(Only(MonthsDiff)/3) as Value
Resident Data
GROUP BY Project, %DATE_KEY, Start;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2019 11:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565128#M441627</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-04T11:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565135#M441628</link>
      <description>Sunny,&lt;BR /&gt;I probably took more time to explain the problem to you than the time you took to give me a solution. It's fantastic. Thank you so much.</description>
      <pubDate>Thu, 04 Apr 2019 12:09:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565135#M441628</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2019-04-04T12:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Assign calculated values per month between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565145#M441629</link>
      <description>&lt;P&gt;I think a good explanation is part of getting to the correct answer quickly. A lot of the time people just think that they can put anything out there and can expect to get a response which will work for them. So, kudos to you for spending time to go over in details as to what you have and what you needed.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 12:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-calculated-values-per-month-between-2-dates/m-p/1565145#M441629</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-04T12:23:47Z</dc:date>
    </item>
  </channel>
</rss>

