<?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: Set_analysis in script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411975#M694872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for helping!&lt;/P&gt;&lt;P&gt;Aggregation using SUM will not help me since I don't want the sum of ALL the events, but only the sum of the events up to the last_one_before_today.&lt;/P&gt;&lt;P&gt;The trick is, that list does not contain every date, only those with events, so I don't know if the last_date_of_an_event is today or not. So I have to distinguish:&lt;/P&gt;&lt;P&gt;- In case the last event was today, I have to sum up all the amounts but for the last one (today's amount)&lt;/P&gt;&lt;P&gt;- In case the last event was before today, I have to sum up all the amounts regardless.&lt;/P&gt;&lt;P&gt;I can try using just one LOAD statement with that WHERE clause, however.&lt;/P&gt;&lt;P&gt;That way, I will automatically get the data from the last event before today, regardless whether there was an event today or not.&lt;/P&gt;&lt;P&gt;In the result_qvd file I store away I can then load two amounts (identical as likely as not), the amount_up_to_today and the amount_before_today. I can also load the date_of_the_last_event_before_today and I can generate today's date, so I would have everything I need.&lt;/P&gt;&lt;P&gt;That's as far as theory goes &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I'll be back to let you know how it compares to reality.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Okay, I had to replace SET by LET (to evaluate the expression), now it seems to work. I will test by manipulating the base_list, but the script now runs without error, which is a big step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.P.S.: Well, the script runs without an error - but the values I want to calculate are never generated or so it seems - when I load the finished result_qvd (including those fields) into a new document (using the FIRST 1 parameter since I want only one line), there is nothing in those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code for generating those values is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN(orig_table)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(Datum_final) as Datum_letzter_Vorfall_vor_heute,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(Schadenshöhe) as Schaeden_bis_zuletzt&lt;BR /&gt;RESIDENT Staplerschaeden&lt;BR /&gt;WHERE(Datum_final &amp;lt; $(v_today));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should in any case generate the data for the last_event_before_today, shouldn't it? I subsequently load data into a new table for storing it away in a result_qvd:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Staplerschaeden_Erg:&lt;/P&gt;&lt;P&gt;FIRST 1&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jahresobergrenze,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Schadenshöhe) as Schaeden_bisher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Schaeden_bis_zuletzt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_letzter_Vorfall_vor_heute&lt;/P&gt;&lt;P&gt;Resident Staplerschaeden&lt;/P&gt;&lt;P&gt;GROUP BY Jahresobergrenze, Schaeden_bis_zuletzt, Datum_letzter_Vorfall_vor_heute;&lt;/P&gt;&lt;P&gt;STORE...;&lt;/P&gt;&lt;P&gt;DROP TABLE ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I go through the script in debugging_mode, I can see that in the step where those calculated values should be generated and joined to the orig_table, 0 records are being retrieved.&lt;/P&gt;&lt;P&gt;Can you spot any error in that code?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 07:13:55 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2013-05-28T07:13:55Z</dc:date>
    <item>
      <title>Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411972#M694869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I cannot use set_analysis in the script, can I? I haven't yet got it going anyway.&lt;/P&gt;&lt;P&gt;I have a list of damage events with a date - that might or might not contain today's date, depending on whether there was such an event today or not. I want to display a trend - whether the situation looks better today than on the last day that there was an event. Thus, in case there was an event today, I have to compare the sum we have today (incl. today's event) with that we had last time (not incl. today's event).&lt;/P&gt;&lt;P&gt;I am doing a RESIDENT LOAD from that table to determine the last date when such an event took place and, if there was one today, I take the date before that from the list.&lt;/P&gt;&lt;P&gt;The next thing I would like to do is, in case there was an event today and I have thus loaded the date before that, to determine the sum of amounts we had until the last day - not including today's amount.&lt;/P&gt;&lt;P&gt;The trick is, I have to somehow do this in the script because I want to load all the relevant data in a new table and store it in a result_qvd. But I have failed up to now because it doesn't seem possible to use set_analysis in the script.&lt;/P&gt;&lt;P&gt;Can anybody help me with an idea how I can load the &amp;gt;&amp;gt;&amp;nbsp; sum of amounts up to the last event-date before today&amp;nbsp; &amp;lt;&amp;lt; - or simply the amount of today(in case there is one)?&lt;/P&gt;&lt;P&gt;I hope I have described my problem sufficiently precise, it is quite complicated a matter...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2013 13:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411972#M694869</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-05-27T13:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411973#M694870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script you can use SQL Group By, Sum ... does not help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Rebeca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2013 16:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411973#M694870</guid>
      <dc:creator />
      <dc:date>2013-05-27T16:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411974#M694871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure how is organized you script, but maybe something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set today = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main_table:&lt;/P&gt;&lt;P&gt;LOAD EVENT, DATE&lt;/P&gt;&lt;P&gt;FORM YOUR SOURCE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_today:&lt;/P&gt;&lt;P&gt;LOAD sum(EVENT) AS EVENT_TODAY&lt;/P&gt;&lt;P&gt;RESIDENT main_table&lt;/P&gt;&lt;P&gt;WHERE DATE = $(today);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_before:&lt;/P&gt;&lt;P&gt;LOAD sum(EVENT) AS EVENT_BEFORE&lt;/P&gt;&lt;P&gt;RESIDENT main_table&lt;/P&gt;&lt;P&gt;WHERE DATE &amp;lt; $(today)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have then your two value&lt;/P&gt;&lt;P&gt;the thing is I don't know how you want to process them;&lt;/P&gt;&lt;P&gt;Maybe you can extract those two values in variables in order to compare them ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 May 2013 17:06:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411974#M694871</guid>
      <dc:creator />
      <dc:date>2013-05-27T17:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411975#M694872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for helping!&lt;/P&gt;&lt;P&gt;Aggregation using SUM will not help me since I don't want the sum of ALL the events, but only the sum of the events up to the last_one_before_today.&lt;/P&gt;&lt;P&gt;The trick is, that list does not contain every date, only those with events, so I don't know if the last_date_of_an_event is today or not. So I have to distinguish:&lt;/P&gt;&lt;P&gt;- In case the last event was today, I have to sum up all the amounts but for the last one (today's amount)&lt;/P&gt;&lt;P&gt;- In case the last event was before today, I have to sum up all the amounts regardless.&lt;/P&gt;&lt;P&gt;I can try using just one LOAD statement with that WHERE clause, however.&lt;/P&gt;&lt;P&gt;That way, I will automatically get the data from the last event before today, regardless whether there was an event today or not.&lt;/P&gt;&lt;P&gt;In the result_qvd file I store away I can then load two amounts (identical as likely as not), the amount_up_to_today and the amount_before_today. I can also load the date_of_the_last_event_before_today and I can generate today's date, so I would have everything I need.&lt;/P&gt;&lt;P&gt;That's as far as theory goes &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I'll be back to let you know how it compares to reality.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Okay, I had to replace SET by LET (to evaluate the expression), now it seems to work. I will test by manipulating the base_list, but the script now runs without error, which is a big step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.P.S.: Well, the script runs without an error - but the values I want to calculate are never generated or so it seems - when I load the finished result_qvd (including those fields) into a new document (using the FIRST 1 parameter since I want only one line), there is nothing in those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code for generating those values is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN(orig_table)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(Datum_final) as Datum_letzter_Vorfall_vor_heute,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(Schadenshöhe) as Schaeden_bis_zuletzt&lt;BR /&gt;RESIDENT Staplerschaeden&lt;BR /&gt;WHERE(Datum_final &amp;lt; $(v_today));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should in any case generate the data for the last_event_before_today, shouldn't it? I subsequently load data into a new table for storing it away in a result_qvd:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Staplerschaeden_Erg:&lt;/P&gt;&lt;P&gt;FIRST 1&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jahresobergrenze,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Schadenshöhe) as Schaeden_bisher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Schaeden_bis_zuletzt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_letzter_Vorfall_vor_heute&lt;/P&gt;&lt;P&gt;Resident Staplerschaeden&lt;/P&gt;&lt;P&gt;GROUP BY Jahresobergrenze, Schaeden_bis_zuletzt, Datum_letzter_Vorfall_vor_heute;&lt;/P&gt;&lt;P&gt;STORE...;&lt;/P&gt;&lt;P&gt;DROP TABLE ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I go through the script in debugging_mode, I can see that in the step where those calculated values should be generated and joined to the orig_table, 0 records are being retrieved.&lt;/P&gt;&lt;P&gt;Can you spot any error in that code?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 07:13:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411975#M694872</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-05-28T07:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411976#M694873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friedrich&lt;/P&gt;&lt;P&gt;Maybe I can try to help you, but I forgot all my German since highschool, so it's kind of hard to understand&lt;/P&gt;&lt;P&gt;Could you repost it with english name ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure I understand your FIRST 1 part.&lt;/P&gt;&lt;P&gt;I have never seen it. I suppose it loads the first line ??&lt;/P&gt;&lt;P&gt;Are you sure you table is sorted correctly before you extract the first line ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411976#M694873</guid>
      <dc:creator />
      <dc:date>2013-05-28T12:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411977#M694874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think in fact you can't predict wich will be the first line of &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Staplerschaeden_Erg because there is a group by clause in it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Maybe do :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Staplerschaeden_Erg0:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;FIRST 1&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;LOAD&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jahresobergrenze,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Schadenshöhe) as Schaeden_bisher,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Schaeden_bis_zuletzt,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_letzter_Vorfall_vor_heute&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Resident Staplerschaeden&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;GROUP BY Jahresobergrenze, Schaeden_bis_zuletzt, Datum_letzter_Vorfall_vor_heute&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;ORDER BY your_order_criteria ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Staplerschaeden_Erg&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;FIRST 1&lt;/P&gt;&lt;P&gt;NOCONCATENATE&lt;/P&gt;&lt;P&gt;LOAD * RESIDENT &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Staplerschaeden_Erg&lt;/SPAN&gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Staplerschaeden_Erg&lt;/SPAN&gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411977#M694874</guid>
      <dc:creator />
      <dc:date>2013-05-28T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411978#M694875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi yadurand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to use this GROUP BY clause because of that sum function I have in that LOAD. &lt;/P&gt;&lt;P&gt;I tried the FIRST 1 parameter because I want only one line in that result_table (Staplerschaeden_Erg). So I need to make sure there is the same value in every line which is why I join those calculated values to the original values. Then the sorting order does not matter as I don't extract any of the original values.&lt;/P&gt;&lt;P&gt;The german words in my post are only the fieldnames, they don't make any difference.&lt;/P&gt;&lt;P&gt;I will try to get rid of the need for a GROUP BY clause in the final LOAD (for the result_qvd).&lt;/P&gt;&lt;P&gt;That, however, does not bring me closer to my actual requirement: I want to sum up all the amounts until the last_one_before_today.&lt;/P&gt;&lt;P&gt;I will be back tomorrow. Have to be working on something else now.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 14:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411978#M694875</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-05-28T14:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411979#M694876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try once more to formulate my exact requirement as precisely as possible, I guess I have been a bit ambiguous:&lt;/P&gt;&lt;P&gt;Beginning from the end, there should be four fields in my result_qvd:&lt;/P&gt;&lt;P&gt;- An upper limit (a static field from the list) -&amp;gt; no problem&lt;/P&gt;&lt;P&gt;- The total sum of amounts (up to today) -&amp;gt; no problem&lt;/P&gt;&lt;P&gt;- The last_date_before_today from the list (might be several days back)&lt;/P&gt;&lt;P&gt;- The sum of amounts up to the last_date_before_today&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is what I have and how I think I can get there:&lt;/P&gt;&lt;P&gt;- I have two LOAD commands from two worksheets (same workbook, identical structure), which are concatenated.&lt;/P&gt;&lt;P&gt;- I already have this code following the two LOADs which works fine:&lt;/P&gt;&lt;P&gt;JOIN (orig_table)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(max(Datum_final)=TODAY(), max(Datum_final, 2), max(Datum_final)) as Datum_letzter_Vorfall&lt;/P&gt;&lt;P&gt;RESIDENT Staplerschaeden;&lt;/P&gt;&lt;P&gt;- Now I want to have one more value to join to my orig_table: The amount of values up to the date I have just calculated (last_date_before_today).&lt;/P&gt;&lt;P&gt;It would be cool if I could get both values in one RESIDENT LOAD and join them to the original table -&amp;gt; then I could use the FIRST 1 option to make sure I only load one record into my result_qvd.&lt;/P&gt;&lt;P&gt;Can anybody help me there?&lt;/P&gt;&lt;P&gt;Can I, when I load max(Datum) with a WHERE clause, somehow tell QlikView to return one other value from the same record? In that case, I could just load the sum of amounts from all records where(date&amp;lt;today) and that should be it, no?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 12:47:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411979#M694876</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-05-29T12:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set_analysis in script?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411980#M694877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've made it.&lt;/P&gt;&lt;P&gt;I don't know why - and why it didn't work before.&lt;/P&gt;&lt;P&gt;I have now done just what I wanted to do all along:&lt;/P&gt;&lt;P&gt;- Load (RESIDENT) the total sum of all amounts up to before_today as well as the corresp. date&lt;/P&gt;&lt;P&gt;- JOIN those calculated values to the original table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can use the FIRST 1 option to load just one record from the original table, at the same time summing up all the amounts (incl. today), I can simply generate today's date and there I have my four core values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all of you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 13:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-in-script/m-p/411980#M694877</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-05-29T13:26:33Z</dc:date>
    </item>
  </channel>
</rss>

