<?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 Calculation in load script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculation-in-load-script/m-p/1596574#M44102</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've imported data from a table that gives feedback on emails, like was it opened, clicked,... .&lt;/P&gt;&lt;P&gt;This generates a lot of data. I currently have everything starting from 20180101 up untill today loaded. This are +- 190Million records. I need all of these as year-to-year analysis should be possible. For future use in other projects, I also need to import every record.&lt;/P&gt;&lt;P&gt;I build some measures that I need in a sheet. However, this takes a long time to calculate for all these records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to transform this to perfom te calculations (aggregated) in the load scipt.&lt;/P&gt;&lt;P&gt;Here's what I have now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TRANS_FLAGS_UNIQUE:

LOAD 
     Min(Date(ACTIONDATE,'DD/MM/YYYY')) as Date,
     CAMPAIGNID,
     ACTIONID,
     PROBEID,
     USERID,
     if(match(mid(PROBEID,1,3),'-1_','-10'),'Yes','No') 		as Unique_Opened,
     if(PROBEID &amp;gt;'0' AND PROBEID &amp;lt;&amp;gt; '0_-_MKT' AND PROBEID&amp;lt;&amp;gt;'0_-_SIM' AND PROBEID&amp;lt;&amp;gt;'0_-_COMM','Yes','No') as Unique_Clicked,
     if(match(mid(PROBEID,1,3),'9_-','500'),'Yes','No') as Unique_Optout
FROM [lib://Manual Data Shared Folder/rdeconin/CRM RMD Campaign Analysis/QVD/RAW_F_RAWFLAGS.qvd]
(qvd)
group by CAMPAIGNID, ACTIONID, PROBEID, USERID;&lt;/LI-CODE&gt;&lt;P&gt;How can I calculate the sum of all opened, clicked, etc in the load script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 05:28:00 GMT</pubDate>
    <dc:creator>robindc</dc:creator>
    <dc:date>2024-11-16T05:28:00Z</dc:date>
    <item>
      <title>Calculation in load script</title>
      <link>https://community.qlik.com/t5/App-Development/Calculation-in-load-script/m-p/1596574#M44102</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've imported data from a table that gives feedback on emails, like was it opened, clicked,... .&lt;/P&gt;&lt;P&gt;This generates a lot of data. I currently have everything starting from 20180101 up untill today loaded. This are +- 190Million records. I need all of these as year-to-year analysis should be possible. For future use in other projects, I also need to import every record.&lt;/P&gt;&lt;P&gt;I build some measures that I need in a sheet. However, this takes a long time to calculate for all these records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to transform this to perfom te calculations (aggregated) in the load scipt.&lt;/P&gt;&lt;P&gt;Here's what I have now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TRANS_FLAGS_UNIQUE:

LOAD 
     Min(Date(ACTIONDATE,'DD/MM/YYYY')) as Date,
     CAMPAIGNID,
     ACTIONID,
     PROBEID,
     USERID,
     if(match(mid(PROBEID,1,3),'-1_','-10'),'Yes','No') 		as Unique_Opened,
     if(PROBEID &amp;gt;'0' AND PROBEID &amp;lt;&amp;gt; '0_-_MKT' AND PROBEID&amp;lt;&amp;gt;'0_-_SIM' AND PROBEID&amp;lt;&amp;gt;'0_-_COMM','Yes','No') as Unique_Clicked,
     if(match(mid(PROBEID,1,3),'9_-','500'),'Yes','No') as Unique_Optout
FROM [lib://Manual Data Shared Folder/rdeconin/CRM RMD Campaign Analysis/QVD/RAW_F_RAWFLAGS.qvd]
(qvd)
group by CAMPAIGNID, ACTIONID, PROBEID, USERID;&lt;/LI-CODE&gt;&lt;P&gt;How can I calculate the sum of all opened, clicked, etc in the load script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculation-in-load-script/m-p/1596574#M44102</guid>
      <dc:creator>robindc</dc:creator>
      <dc:date>2024-11-16T05:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation in load script</title>
      <link>https://community.qlik.com/t5/App-Development/Calculation-in-load-script/m-p/1596774#M44122</link>
      <description>&lt;P&gt;I don't think that I would try to solve this task by aggregating the data within the script. An aggregation load over 190 M records over multiple grouping fields is a very heavy transformation and must need some time and I assume that with all these grouping fields you won't get a very high compression-rate - probably something like 1:5 or less which means that there are further around 40 M records in the table.&lt;/P&gt;&lt;P&gt;I suggest that you load these data without any aggregation - only performing the needed flagging and splitting dates and times in separate fields (I assume that your Date field is really a timestamp - and it may be already done one step before by creating this qvd).&lt;/P&gt;&lt;P&gt;Maybe you need some further measures for all your requirements but if you could apply in the end rather simple expression like: sum/count({ set analysis } field) it should work quite smoothly even with 190 M records. As far as you apply (nested) if-loops and/or aggr() it will be probably too slow (whereby it won't be really much better if it are only 40 M of records).&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 12:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculation-in-load-script/m-p/1596774#M44122</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-06-27T12:53:02Z</dc:date>
    </item>
  </channel>
</rss>

