<?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 Archiving logic - not yet working - plz help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200303#M624876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script to compute the current usage of available storage capacities.&lt;/P&gt;&lt;P&gt;This report can potentially be run at any time - but it should archive exactly one value per day, always at the ame time, inbetween the early and late shift (at 1:45 pm or a bit later). At that time, the report is run via the QMC and then it should check whether a record for the current day is already in the existing history_file, and if not, it should concatenate one and save it again.&lt;/P&gt;&lt;P&gt;For some reason that logic does not yet work. Maybe someone here can help me:&lt;/P&gt;&lt;P&gt;The code is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Jetzt laden wir erst mal die bestehende Historiendatei:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; Hist_old:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(v_Pfad_Lager_Hist_74_qvd) // This variable holds the path to the history.qvd which I have put together before this&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;);&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Um überprüfen zu können, ob wir für heute schon einen Wert haben - es soll ja nur einen Auslastungs-Wert pro Tag geben - brauchen wir&lt;BR /&gt; // das heutige Datum und schauen einfach den untersten Eintrag in der Tabelle an, die ja chronologisch sortiert ist - wenn der unterste Eintrag&lt;BR /&gt; // das heutige Datum hat, dann gibt es da eben schon Daten, ansonsten hängen wir den neuen Eintrag an.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;Let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_today&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;();&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wir setzen als Standard erst mal, dass wir nix machen.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Maketime&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(13, 45, 00) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Der Report läuft, über die QMC gesteuert, zum Schichtwechsel und speichert da jew. den Lagerauslastungs-Status weg. Wenn es&lt;BR /&gt; // noch früher ist als das, dann prüfen wir hier noch gar nix. Damit bleibt die Variable auf 0, wir hängen keine neuen Daten an.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;PEEK&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('Datum_Hist', -1, 'Hist_old') = '$(v_today)' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ELSE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wenn diese Variable den Wert 1 hat, dann hängen wir die neue Datei an die alte dran.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;v_concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (Hist_old)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RESIDENT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_new;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;DROP&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_new;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Jetzt ist die Historiendatei aktualisiert, jetzt schreiben wir sie wieder weg.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;v_concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wenn wir keine neuen Daten angehängt haben, dann brauchen wir auch keine neue qvd, denn die liegt ja schon da.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;STORE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_old &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INTO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(v_Pfad_Lager_Hist_74_qvd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; For some reason, the first IF_THEN clause (the comparison with the time) does not work - it is now 11:30 am, but still the condition returned true - in Debugging_mode, the cursor entered that clause and computed the inner one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;What is wrong there?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Best regsards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;DataNibbler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;P.S.: It seems to be working in general - there are the dates from Oct 10 to today in the file, a varying nr. of records for each day - that looks all right. Only the file has a change_time from today at about 9am which should not be the case - I rasn the report locally at that time all right, but the history_file should only be updated at 1:45 pm like the code says ...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2016 09:39:03 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2016-10-17T09:39:03Z</dc:date>
    <item>
      <title>Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200303#M624876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script to compute the current usage of available storage capacities.&lt;/P&gt;&lt;P&gt;This report can potentially be run at any time - but it should archive exactly one value per day, always at the ame time, inbetween the early and late shift (at 1:45 pm or a bit later). At that time, the report is run via the QMC and then it should check whether a record for the current day is already in the existing history_file, and if not, it should concatenate one and save it again.&lt;/P&gt;&lt;P&gt;For some reason that logic does not yet work. Maybe someone here can help me:&lt;/P&gt;&lt;P&gt;The code is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Jetzt laden wir erst mal die bestehende Historiendatei:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; Hist_old:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(v_Pfad_Lager_Hist_74_qvd) // This variable holds the path to the history.qvd which I have put together before this&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;);&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Um überprüfen zu können, ob wir für heute schon einen Wert haben - es soll ja nur einen Auslastungs-Wert pro Tag geben - brauchen wir&lt;BR /&gt; // das heutige Datum und schauen einfach den untersten Eintrag in der Tabelle an, die ja chronologisch sortiert ist - wenn der unterste Eintrag&lt;BR /&gt; // das heutige Datum hat, dann gibt es da eben schon Daten, ansonsten hängen wir den neuen Eintrag an.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;Let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_today&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;();&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wir setzen als Standard erst mal, dass wir nix machen.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Maketime&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(13, 45, 00) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Der Report läuft, über die QMC gesteuert, zum Schichtwechsel und speichert da jew. den Lagerauslastungs-Status weg. Wenn es&lt;BR /&gt; // noch früher ist als das, dann prüfen wir hier noch gar nix. Damit bleibt die Variable auf 0, wir hängen keine neuen Daten an.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;PEEK&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('Datum_Hist', -1, 'Hist_old') = '$(v_today)' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ELSE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;v_concat&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wenn diese Variable den Wert 1 hat, dann hängen wir die neue Datei an die alte dran.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;v_concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (Hist_old)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Regalreihe_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Werk_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Bereich_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Gesamtkapazität_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hist_new.Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Beladung_Hist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RESIDENT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_new;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;DROP&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_new;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Jetzt ist die Historiendatei aktualisiert, jetzt schreiben wir sie wieder weg.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;v_concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Wenn wir keine neuen Daten angehängt haben, dann brauchen wir auch keine neue qvd, denn die liegt ja schon da.&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;STORE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Hist_old &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INTO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-size: 8pt;"&gt;&lt;EM&gt;$(v_Pfad_Lager_Hist_74_qvd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;ENDIF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; For some reason, the first IF_THEN clause (the comparison with the time) does not work - it is now 11:30 am, but still the condition returned true - in Debugging_mode, the cursor entered that clause and computed the inner one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;What is wrong there?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Best regsards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;DataNibbler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;P.S.: It seems to be working in general - there are the dates from Oct 10 to today in the file, a varying nr. of records for each day - that looks all right. Only the file has a change_time from today at about 9am which should not be the case - I rasn the report locally at that time all right, but the history_file should only be updated at 1:45 pm like the code says ...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 09:39:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200303#M624876</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2016-10-17T09:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200304#M624877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are comparing a timestamp with a time ... therefore try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;STRONG&gt;frac(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()&lt;STRONG&gt;)&lt;/STRONG&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Maketime&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(13, 45, 00) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;THEN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 11:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200304#M624877</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-17T11:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200305#M624878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks! yes, I noticed that yesterday. I tried with TIME(NOW()) - that seems to work, at least on the GUI it did.&lt;/P&gt;&lt;P&gt;Frac(Now()) seems to be a lot more precise, I put that into the code for now. Let's see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 06:37:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200305#M624878</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2016-10-18T06:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200306#M624879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;time() will only format the string-representation but the numerical value is yet a timestamp - therefore frac() to split the time-part from the timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 07:04:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200306#M624879</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-18T07:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200307#M624880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there seems to have been another problem - or maybe it was that: In a copy that I am working on, I was using TIME(NOW()) instead of frac. It is now 09:20am, I just ran the report and that history.qvd was obviously updated ...&lt;/P&gt;&lt;P&gt;I could now remove today's data from the history.qvd again, let's see.&lt;/P&gt;&lt;P&gt;Can you spot something else or is it really that part that made the whole thing misbehave?&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;I'll just try it out - I just removed today's data again and replaced my TIME() with frac() and now I'll run it again ...&lt;/P&gt;&lt;P&gt;Seems to work. The timestamp stayed the same, seemingly no data was added.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 07:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200307#M624880</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2016-10-18T07:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200308#M624881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is another point which might cause an issue - the fact that you pulled the date from the last record from the history-table to compare it with today. If your history-data not always ordered chronologically it might fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside them I could imagine that it might be more useful to use a &lt;STRONG&gt;where exists(Datum)&lt;/STRONG&gt; clause instead of checking the date with peek and further that avoiding qualifying the fields made the load- and table-handling easier (maybe a filebasename() or 'current' / 'history' as Source could solve the purpose to keep an overview which data comes from which source respectively to access them over these field-flags).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 10:43:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200308#M624881</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-10-18T10:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving logic - not yet working - plz help</title>
      <link>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200309#M624882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you're right. If the history.qvd is not chronologically sorted, then PEEK() might cause issues of course - but why should it not be? Every day's new data is appended to the end of the history_table, so - given no one messes around with that table - it should always be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could of course check the existence of today's date in the table first thing and if it is already there, all the ado about that &amp;gt;&amp;gt;Hist_new&amp;lt;&amp;lt; would not be necessary - but it seems to work and it's not much given the thing runs on the server ...&lt;/P&gt;&lt;P&gt;Just now, both historization files were updated. So there is no acute necessity to change anything.&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>Tue, 18 Oct 2016 11:57:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Archiving-logic-not-yet-working-plz-help/m-p/1200309#M624882</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2016-10-18T11:57:27Z</dc:date>
    </item>
  </channel>
</rss>

