<?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: adding a constant to a sum() and accumulation over weeks/months in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461078#M98845</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/297456"&gt;@Florian01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SET K = 10; // Adjust the value here accordingly&lt;/P&gt;
&lt;P&gt;Ensure the Master Calendar is correctly implemented with Weeks and Months as dimensions.&lt;BR /&gt;Use the accumulation and add the constant ( K ) accordingly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Weeks:&lt;BR /&gt;RangeSum(Above(Total Sum(A), 0, RowNo(TOTAL))) + if(RowNo(TOTAL) = 1, $(K), 0)&lt;/P&gt;
&lt;P&gt;Months:&lt;BR /&gt;RangeSum(Above(Total Sum(A), 0, RowNo(TOTAL))) + if(RowNo(TOTAL) = 1, $(K), 0)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;***Hope this resolve your issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the issue is solved please mark the answer with Accept as Solution &amp;amp; like it.***&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2024 07:44:10 GMT</pubDate>
    <dc:creator>TauseefKhan</dc:creator>
    <dc:date>2024-06-11T07:44:10Z</dc:date>
    <item>
      <title>adding a constant to a sum() and accumulation over weeks/months</title>
      <link>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461068#M98844</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I have following issue:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a line graph with Sum(A) as formula and I also implemented a Mastercalender allowing me to have calender Weeks and Months as dimension).&lt;/P&gt;
&lt;P&gt;I want to use the accumulation option of the graph to show Sum(a) over calender Week and respectively months.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I have to add one constant K only one time to this sum so bascally an offset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I use "=Sum(A) + K' the accumulation does not work correctly because K will be added for each Week/month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to adapt the formula so that the constant K will be added only one time so will not be accumulated?&lt;/P&gt;
&lt;P&gt;Chatgpt proposed me to solutions:&amp;nbsp;&lt;BR /&gt;Solution 1 (for months):&lt;/P&gt;
&lt;P&gt;RangeSum(&lt;BR /&gt;Above(&lt;BR /&gt;Sum({&amp;lt;Month&amp;gt;} A),&lt;BR /&gt;0,&lt;BR /&gt;RowNo(TOTAL)&lt;BR /&gt;)&lt;BR /&gt;) + Only({1} K)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution 2:&lt;/P&gt;
&lt;P&gt;Sum(&amp;lt;Month&amp;gt;} A) + Only({1} K)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;none of them work. I get 0 over the whole timerange for solution 2 and an exponential curve going way too high for solution 1.&lt;/P&gt;
&lt;P&gt;Would be very Happy if I could get some help on this one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Florian&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 07:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461068#M98844</guid>
      <dc:creator>Florian01</dc:creator>
      <dc:date>2024-06-11T07:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: adding a constant to a sum() and accumulation over weeks/months</title>
      <link>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461078#M98845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/297456"&gt;@Florian01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SET K = 10; // Adjust the value here accordingly&lt;/P&gt;
&lt;P&gt;Ensure the Master Calendar is correctly implemented with Weeks and Months as dimensions.&lt;BR /&gt;Use the accumulation and add the constant ( K ) accordingly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Weeks:&lt;BR /&gt;RangeSum(Above(Total Sum(A), 0, RowNo(TOTAL))) + if(RowNo(TOTAL) = 1, $(K), 0)&lt;/P&gt;
&lt;P&gt;Months:&lt;BR /&gt;RangeSum(Above(Total Sum(A), 0, RowNo(TOTAL))) + if(RowNo(TOTAL) = 1, $(K), 0)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;***Hope this resolve your issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the issue is solved please mark the answer with Accept as Solution &amp;amp; like it.***&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 07:44:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461078#M98845</guid>
      <dc:creator>TauseefKhan</dc:creator>
      <dc:date>2024-06-11T07:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: adding a constant to a sum() and accumulation over weeks/months</title>
      <link>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461080#M98846</link>
      <description>&lt;P&gt;thanks for the fast Reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; unfortunaltey with this solution I get the exponentional behavior from the solution 1 from ChatGpt.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 07:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461080#M98846</guid>
      <dc:creator>Florian01</dc:creator>
      <dc:date>2024-06-11T07:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: adding a constant to a sum() and accumulation over weeks/months</title>
      <link>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461086#M98848</link>
      <description>&lt;P&gt;ok I solved it with Sum(A) +&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;if(RowNo(TOTAL) = 1, $(K), 0)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 07:57:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/adding-a-constant-to-a-sum-and-accumulation-over-weeks-months/m-p/2461086#M98848</guid>
      <dc:creator>Florian01</dc:creator>
      <dc:date>2024-06-11T07:57:39Z</dc:date>
    </item>
  </channel>
</rss>

