<?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: Subtract data by date, and accumulate data by date - in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709651#M724855</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Could you explain a bit more about the calculation logic?&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Here is my script. I hope it is understandable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NoConcatenate
Table_example:
load 
	*,
	Num(If("ID"=Peek("ID"), "value"+Peek([Running Total]), "value")) as [Running Total]
Resident table_raw_data where created&amp;gt;=year(today()-1)  Order by "ID", created ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also I see there are multiple values for single date&amp;nbsp;1'6-04-2018 00:04' in your target table, but you needed one value for every dates, right?&lt;BR /&gt;&lt;/STRONG&gt;Yes, I only need all the values from the same date, added together.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2020 08:12:30 GMT</pubDate>
    <dc:creator>varmekontrol</dc:creator>
    <dc:date>2020-06-10T08:12:30Z</dc:date>
    <item>
      <title>Subtract data by date, and accumulate data by date - in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709635#M724851</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This question have probably been answered, but I have not been able to implement the answers I found, in the data I am using. Hopefully, someone here can help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table_example:
Load * inline
[ID,created,value
73241001,13-04-2018 00:04,96
73241001,16-04-2018 00:04,108
73241001,16-04-2018 00:04,109
73241001,16-04-2018 00:04,110
73241001,19-04-2018 00:04,137
73241001,21-04-2018 00:04,138
73241001,22-04-2018 00:04,142
73241001,23-04-2018 00:04,165
73241001,24-04-2018 00:04,177];&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The values in my example are already accumulated by date from another Qlik script.&lt;BR /&gt;Were all values are added to each other from the first date, so the values I really have is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table_raw_data:
Load * inline
[ID,created,value
73241001,13-04-2018 00:04,0
73241001,13-04-2018 00:04,96
73241001,16-04-2018 00:04,14
73241001,16-04-2018 00:04,1
73241001,16-04-2018 00:04,1
73241001,19-04-2018 00:04,27
73241001,21-04-2018 00:04,1
73241001,22-04-2018 00:04,4
73241001,23-04-2018 00:04,13
73241001,24-04-2018 00:04,12;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I have a API that does not accept multiple values on the same date.&lt;BR /&gt;So what I need is something like this:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Concatenate
Table_final:
LOAD *, 
ID,			
created, 	
value,		
//if multiple CREATED exist, subtract VALUE from previous CREATED as SUBTRACTED,
//accumulate all SUBTRACTED by CREATED
Resident Table_example;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709635#M724851</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2024-11-16T00:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract data by date, and accumulate data by date - in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709637#M724852</link>
      <description>&lt;P&gt;What is your expected output from&amp;nbsp;Table_raw_data?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 07:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709637#M724852</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-06-10T07:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract data by date, and accumulate data by date - in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709643#M724853</link>
      <description>&lt;P&gt;The expected outcome of the table&amp;nbsp;&lt;SPAN&gt;Table_raw_data, is Table_example.&amp;nbsp;&lt;BR /&gt;That is my accumulation of the Table_raw_data, so I have accumulated values.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 07:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709643#M724853</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2020-06-10T07:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract data by date, and accumulate data by date - in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709647#M724854</link>
      <description>&lt;P&gt;Could you explain a bit more about the calculation logic? Also I see there are multiple values for single date&amp;nbsp;1'6-04-2018 00:04' in your target table, but you needed one value for every dates, right?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 08:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709647#M724854</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2020-06-10T08:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract data by date, and accumulate data by date - in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709651#M724855</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Could you explain a bit more about the calculation logic?&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Here is my script. I hope it is understandable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NoConcatenate
Table_example:
load 
	*,
	Num(If("ID"=Peek("ID"), "value"+Peek([Running Total]), "value")) as [Running Total]
Resident table_raw_data where created&amp;gt;=year(today()-1)  Order by "ID", created ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also I see there are multiple values for single date&amp;nbsp;1'6-04-2018 00:04' in your target table, but you needed one value for every dates, right?&lt;BR /&gt;&lt;/STRONG&gt;Yes, I only need all the values from the same date, added together.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 08:12:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-data-by-date-and-accumulate-data-by-date-in-load-script/m-p/1709651#M724855</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2020-06-10T08:12:30Z</dc:date>
    </item>
  </channel>
</rss>

