<?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: Accumulate data to some point in bar chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515513#M436943</link>
    <description>&lt;P&gt;Or even this (used Tresesco's solution and made modifications)&lt;/P&gt;&lt;PRE&gt;If(Sum(Value) &amp;gt; 0, RangeSum(Above(Sum({&amp;lt;Day&amp;gt;}Target), 0, RowNo(TOTAL))))&lt;/PRE&gt;&lt;P&gt;This will allow you to select a day and still see the Target&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 852px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1461iBA5EE3FB8AC6CE83/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 12:18:42 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-12-03T12:18:42Z</dc:date>
    <item>
      <title>Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515410#M436931</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have data something like this:&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Acc" style="width: 678px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1445i40E4AEADB84220D2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-12-03 10_40_27-QlikView x64 - [C__Users_pc00280_Desktop_QTests_accumulate data to some point in.png" alt="Acc" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Acc&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is this:&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2018-12-03 10_45_48-QlikView x64 - [C__Users_pc00280_Desktop_QTests_accumulate data to some point in.png" style="width: 758px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1446iAC70A1A2FF429308/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-12-03 10_45_48-QlikView x64 - [C__Users_pc00280_Desktop_QTests_accumulate data to some point in.png" alt="2018-12-03 10_45_48-QlikView x64 - [C__Users_pc00280_Desktop_QTests_accumulate data to some point in.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore all targets before first day where I have data should accumulate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also on last bar (day of the month!), I take targets before and after that bar, to accumulate, and display on that bar (day).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me with this?&lt;/P&gt;&lt;P&gt;Can be set analysis or scripting behind, or maybe window functions in SQL, don't care &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 09:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515410#M436931</guid>
      <dc:creator>retko1985</dc:creator>
      <dc:date>2018-12-03T09:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515425#M436933</link>
      <description>&lt;P&gt;Try like:&lt;/P&gt;&lt;PRE&gt;If(Sum(Value)&amp;gt;0, RangeSum(Above(Sum(Target),0,RowNo(TOTAL))))&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 10:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515425#M436933</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2018-12-03T10:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515446#M436935</link>
      <description>can u explain why your Targetvalue for Day7 = 60?&lt;BR /&gt;I would expect Day7 = 70!</description>
      <pubDate>Mon, 03 Dec 2018 10:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515446#M436935</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2018-12-03T10:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515513#M436943</link>
      <description>&lt;P&gt;Or even this (used Tresesco's solution and made modifications)&lt;/P&gt;&lt;PRE&gt;If(Sum(Value) &amp;gt; 0, RangeSum(Above(Sum({&amp;lt;Day&amp;gt;}Target), 0, RowNo(TOTAL))))&lt;/PRE&gt;&lt;P&gt;This will allow you to select a day and still see the Target&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 852px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1461iBA5EE3FB8AC6CE83/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:18:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515513#M436943</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-03T12:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515528#M436946</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this is not correct.&lt;/P&gt;&lt;P&gt;Here is why Target for second bar is 60, not 70:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2018-12-03 13_37_47-QlikView x64 - [C__Users_pc00280_Downloads_accumulate data to some point in bar .png" style="width: 253px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1463i338D04558A81285A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-12-03 13_37_47-QlikView x64 - [C__Users_pc00280_Downloads_accumulate data to some point in bar .png" alt="2018-12-03 13_37_47-QlikView x64 - [C__Users_pc00280_Downloads_accumulate data to some point in bar .png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;A little more explanation is like this. Value is some accumulation on last week, can be 5 to seven days back, but we have targets for each day (same number for whole month). Now we want to accumulate targets for the same period as is value accumulated. That's why we need to take second part of days, not from starting day of the month. And because it it last BAR of that month I need to take targets after it to the end of the month also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515528#M436946</guid>
      <dc:creator>retko1985</dc:creator>
      <dc:date>2018-12-03T12:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515533#M436947</link>
      <description>&lt;P&gt;But how do we determine that value 50 belongs to day 5 till 10? What is stopping us from thinking that 35 was from 1 till 5 and then 50 was from 6 till 10? I mean is there a week field which was not provided with the data?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:48:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515533#M436947</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-03T12:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515642#M436952</link>
      <description>Our data source has column date, like here. And for day 4 there is a transaction row having value 35. Business said that this number is accumulation from start of the month till the day written for this row.&lt;BR /&gt;Second row has date 7. And there is no row till the end of month. So we can say that this value is for days 5, 6, 7. Bud because it is last value for that month, we want to take targets which are after day 7 till the end of that month, and show it for that day when data came.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 03 Dec 2018 14:34:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515642#M436952</guid>
      <dc:creator>retko1985</dc:creator>
      <dc:date>2018-12-03T14:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515660#M436954</link>
      <description>&lt;P&gt;So, if your sample data was like this&lt;/P&gt;&lt;PRE&gt;Have:
LOAD * INLINE [
    Day, Value, Target
    1, 0, 10
    2, 0, 10
    3, 0, 10
    4, 35, 10
    5, 0, 10
    6, 0, 10
    7, 50, 10
    8, 0, 10
    9, 0, 10
    10, 0, 10
    11, 60, 10
    12, 0, 10
    13, 0, 10
];&lt;/PRE&gt;&lt;P&gt;The expected output will be this?&lt;/P&gt;&lt;PRE&gt;LOAD * INLINE [
    Day_Want, Value_Want, Target_Want
    1, 0, 0
    2, 0, 0
    3, 0, 0
    4, 35, 40
    5, 0, 0
    6, 0, 0
    7, 50, 30
    8, 0, 0
    9, 0, 0
    10, 0, 0
    11, 60, 60
    12, 0, 0
    13, 0, 0
];&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515660#M436954</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-03T14:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515685#M436955</link>
      <description>&lt;P&gt;There might be a better way to do this... but may be do this in the script like this&lt;/P&gt;&lt;PRE&gt;Table:
LOAD *,
	 MonthName(Date) as MonthYear,
	 Day(Date) as Day;
LOAD * INLINE [
    Date, Value, Target
    1/1/2018, 0, 10
    1/2/2018, 0, 10
    1/3/2018, 0, 10
    1/4/2018, 35, 10
    1/5/2018, 0, 10
    1/6/2018, 0, 10
    1/7/2018, 50, 10
    1/8/2018, 0, 10
    1/9/2018, 0, 10
    1/10/2018, 0, 10
    1/11/2018, 60, 10
    1/12/2018, 0, 10
    1/13/2018, 0, 10
    1/14/2018, 0, 10
    1/15/2018, 0, 10
    1/16/2018, 0, 10
    1/17/2018, 0, 10
    1/18/2018, 0, 10
    1/19/2018, 0, 10
    1/20/2018, 0, 10
    1/21/2018, 0, 10
    1/22/2018, 0, 10
    1/23/2018, 0, 10
    1/24/2018, 0, 10
    1/25/2018, 0, 10
    1/26/2018, 0, 10
    1/27/2018, 0, 10
    1/28/2018, 0, 10
    1/29/2018, 0, 10
    1/30/2018, 0, 10
    1/31/2018, 0, 10
    2/1/2018, 0, 10
    2/2/2018, 0, 10
    2/3/2018, 0, 10
    2/4/2018, 0, 10
    2/5/2018, 0, 10
    2/6/2018, 0, 10
    2/7/2018, 0, 10
    2/8/2018, 0, 10
    2/9/2018, 40, 10
    2/10/2018, 0, 10
    2/11/2018, 0, 10
    2/12/2018, 0, 10
    2/13/2018, 0, 10
    2/14/2018, 0, 10
    2/15/2018, 50, 10
    2/16/2018, 0, 10
    2/17/2018, 0, 10
    2/18/2018, 0, 10
    2/19/2018, 0, 10
    2/20/2018, 0, 10
    2/21/2018, 0, 10
    2/22/2018, 60, 10
    2/23/2018, 0, 10
    2/24/2018, 0, 10
    2/25/2018, 0, 10
    2/26/2018, 0, 10
    2/27/2018, 0, 10
    2/28/2018, 80, 10
];

TempTable:
LOAD *,
	 If(MonthYear = Previous(MonthYear) and Previous(Value) = 0, RangeSum(Peek('CumTarget'), Target), Target) as CumTarget
Resident Table;

Left Join (TempTable)
LOAD MonthYear,
	 Max(New_CumTarget) as New_CumTarget,
	 Max(If(Value &amp;lt;&amp;gt; 0, Date)) as Date
Group By MonthYear;
LOAD MonthYear,
	 Date,
	 Value,
	 If(Floor(MonthEnd(MonthYear)) = Date, CumTarget) as New_CumTarget
Resident TempTable
Where (Floor(MonthEnd(MonthYear)) = Date) or Value &amp;lt;&amp;gt; 0;

FinalTable:
LOAD Date,
	 Value,
	 Target,
	 MonthYear,
	 Day,
	 RangeSum(If(Floor(MonthEnd(MonthYear)) = Date, 0, New_CumTarget), CumTarget) as Cum_Target
Resident TempTable;

DROP Tables Table, TempTable;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515685#M436955</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-03T15:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulate data to some point in bar chart</title>
      <link>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515725#M436956</link>
      <description>Seems to work on example data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So I will test it on my data, and will let you know. Thank you very much for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Accumulate-data-to-some-point-in-bar-chart/m-p/1515725#M436956</guid>
      <dc:creator>retko1985</dc:creator>
      <dc:date>2018-12-03T15:58:05Z</dc:date>
    </item>
  </channel>
</rss>

