<?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 CUmmulative sum in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/CUmmulative-sum/m-p/1947226#M16977</link>
    <description>&lt;P&gt;I want to represent the evolution of repairs done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data i have is the following: CampaignID, ProductID, ProdCampID, EntryDate and AcceptedDate.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;CampaignID&lt;/STRONG&gt;&lt;/EM&gt; is the reparation campaign, depending on the reparation needed for each product it will be classified into a different Campaign.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ProductID&lt;/STRONG&gt;&lt;/EM&gt; is the ID of each particular product and this is unique&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; is the union of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;CampaignID and&amp;nbsp;ProductID&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;because although the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ProductID&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; is unique, a Product can simultaneously be in two or more reparation Campaigns.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EntryDate&lt;/STRONG&gt; is the date in which the product entered the reparation Campaign.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AcceptedDate&lt;/STRONG&gt; is the date in which the product was 'accepted' as okay due to a successful reparation&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have created a CanonicalDate that includes both entry and accepted dates and now I would like to create a graph with the evolution of how many Products entered a reparation campaing as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="atudela_0-1655969785002.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/82476iC37D60E81C4CBFB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="atudela_0-1655969785002.png" alt="atudela_0-1655969785002.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this graph&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;blue bar:&lt;/STRONG&gt;&lt;/EM&gt; the total number of units that have entered the campaign (this is the cumulative sum of the units)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;red bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;of the&amp;nbsp;total number of units that have entered the campaign, how many of these have been accepted&amp;nbsp;(also cummulative)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;light green bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;the number of units that have entered a campaign that particular day&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;yellow bar:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;the number of units that are in campaign and have not been repaired yet, that are pending&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dark green bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;the number of products that have been accepted that particular day&lt;/P&gt;
&lt;P&gt;I came up with the following way of representing this: (the DateType variable was created during the Canonical date creation in order to be able to distinguish between entry and accepted dates)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;blue bar(&lt;/EM&gt;&amp;nbsp;entered units-cummulative):&amp;nbsp;&lt;/STRONG&gt;count(distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;red bar (accepted units-cummulative ) :&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Accepted'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;light green bar (entered units):&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;yellow bar (pending units):&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;rangesum(above(total count( distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; ),0,RowNo(total)))-rangesum(above(total count(distinct{&amp;lt;DateType={'Accepted'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; ),0,RowNo(total))) &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dark green bar (accepted units):&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Accepted'} &amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;but unfortunately this has been done in the front end and so date selections have an effect on the sums calculated and do not give a real cumulative answer. I checked the read only option, but doing this selections such as the Campaign cannot be applied...&lt;/P&gt;
&lt;P&gt;I would like to do this is the back end, in the script, but I am having issues with the cummulaive part and I am not sure how to do this. Any help would be welcomed!&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 07:57:04 GMT</pubDate>
    <dc:creator>atudela</dc:creator>
    <dc:date>2022-06-23T07:57:04Z</dc:date>
    <item>
      <title>CUmmulative sum</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/CUmmulative-sum/m-p/1947226#M16977</link>
      <description>&lt;P&gt;I want to represent the evolution of repairs done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data i have is the following: CampaignID, ProductID, ProdCampID, EntryDate and AcceptedDate.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;CampaignID&lt;/STRONG&gt;&lt;/EM&gt; is the reparation campaign, depending on the reparation needed for each product it will be classified into a different Campaign.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ProductID&lt;/STRONG&gt;&lt;/EM&gt; is the ID of each particular product and this is unique&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; is the union of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;CampaignID and&amp;nbsp;ProductID&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;because although the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ProductID&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; is unique, a Product can simultaneously be in two or more reparation Campaigns.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EntryDate&lt;/STRONG&gt; is the date in which the product entered the reparation Campaign.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AcceptedDate&lt;/STRONG&gt; is the date in which the product was 'accepted' as okay due to a successful reparation&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have created a CanonicalDate that includes both entry and accepted dates and now I would like to create a graph with the evolution of how many Products entered a reparation campaing as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="atudela_0-1655969785002.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/82476iC37D60E81C4CBFB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="atudela_0-1655969785002.png" alt="atudela_0-1655969785002.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this graph&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;blue bar:&lt;/STRONG&gt;&lt;/EM&gt; the total number of units that have entered the campaign (this is the cumulative sum of the units)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;red bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;of the&amp;nbsp;total number of units that have entered the campaign, how many of these have been accepted&amp;nbsp;(also cummulative)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;light green bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;the number of units that have entered a campaign that particular day&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;yellow bar:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;the number of units that are in campaign and have not been repaired yet, that are pending&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dark green bar:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;the number of products that have been accepted that particular day&lt;/P&gt;
&lt;P&gt;I came up with the following way of representing this: (the DateType variable was created during the Canonical date creation in order to be able to distinguish between entry and accepted dates)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;blue bar(&lt;/EM&gt;&amp;nbsp;entered units-cummulative):&amp;nbsp;&lt;/STRONG&gt;count(distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;red bar (accepted units-cummulative ) :&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Accepted'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;light green bar (entered units):&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;yellow bar (pending units):&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;rangesum(above(total count( distinct{&amp;lt;DateType={'Entry'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; ),0,RowNo(total)))-rangesum(above(total count(distinct{&amp;lt;DateType={'Accepted'}&amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; ),0,RowNo(total))) &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dark green bar (accepted units):&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;count(distinct{&amp;lt;DateType={'Accepted'} &amp;gt;} &lt;EM&gt;&lt;STRONG&gt;ProdCampID&lt;/STRONG&gt;&lt;/EM&gt; )&lt;/P&gt;
&lt;P&gt;but unfortunately this has been done in the front end and so date selections have an effect on the sums calculated and do not give a real cumulative answer. I checked the read only option, but doing this selections such as the Campaign cannot be applied...&lt;/P&gt;
&lt;P&gt;I would like to do this is the back end, in the script, but I am having issues with the cummulaive part and I am not sure how to do this. Any help would be welcomed!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 07:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/CUmmulative-sum/m-p/1947226#M16977</guid>
      <dc:creator>atudela</dc:creator>
      <dc:date>2022-06-23T07:57:04Z</dc:date>
    </item>
  </channel>
</rss>

