<?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 Overwrite old data with the new one in Qliksense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Overwrite-old-data-with-the-new-one-in-Qliksense/m-p/1944957#M77879</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I have below data :-&lt;/P&gt;
&lt;P&gt;[DATE_LABELS]:&lt;BR /&gt;LOAD DATEKEY AS DATE_LABELS.DATEKEY, &lt;BR /&gt;DATE(DATE#(DATEKEY,'YYYYMMDD'),'DD-MMM-YY') AS [REPORT DATE],&lt;BR /&gt;PERIOD_TYPE AS DATE_LABELS.PERIOD_TYPE, &lt;BR /&gt;DATE_LABEL, &lt;BR /&gt;THEDATE, &lt;BR /&gt;ENDDATE, &lt;BR /&gt;SORT_ORDER,&lt;BR /&gt;DATEKEY&amp;amp;PERIOD_TYPE AS DATE_LABEL_KEY;&lt;BR /&gt;SELECT "DATEKEY",&lt;BR /&gt;"PERIOD_TYPE",&lt;BR /&gt;"DATE_LABEL",&lt;BR /&gt;"THEDATE",&lt;BR /&gt;"ENDDATE",&lt;BR /&gt;"SORT_ORDER"&lt;BR /&gt;FROM "ENTERPRISE_EPR"."PPL_SBDB_DATE_LABELS";&lt;/P&gt;
&lt;P&gt;Now, in this&amp;nbsp; Report Date has data for 15th june and data is reloaded and stored into qvd. Now, when the data is reloaded next day, so it before loading it should check if the report_date has the data for 16 th june. if yes, the old data should be overwrite the new one , if not , no change should be there and the qvd should stick with the data for 15 june.&lt;/P&gt;
&lt;P&gt;Initially I was thinking to use incremental insert and update but it is not applicable in my case as I don't want the table to be loaded until the condition for date is met.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have done for far is :-&lt;/P&gt;
&lt;P&gt;1)I loaded the data table and stored it into qvd named History.qvd&amp;nbsp; and calculated max(date) and stored in in the variable like below :-&lt;/P&gt;
&lt;P&gt;Max:&lt;/P&gt;
&lt;P&gt;Load Max(Report _Date) as Max Date&lt;/P&gt;
&lt;P&gt;Resident Data Label&lt;/P&gt;
&lt;P&gt;Vmax = peek ('Max Date', Max )&amp;nbsp; &amp;nbsp;// this max date is calculated on the history.qvd&lt;/P&gt;
&lt;P&gt;Drop table Data Label&lt;/P&gt;
&lt;P&gt;2) secondly I again loaded Data label table and this time I only loaded&amp;nbsp; Date field and again calculated max(date) and stored into today .qvd&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, I what I am trying to do is create an if condition before the load of data label table that will check the maxdate of history .qvd and will check if it is greater than or equal to the maxdate calculated from today.qvd&lt;/P&gt;
&lt;P&gt;The problem I am facing here is how should I apply this if condition so that the data is only reloaded when the condition is met. Also, not sure if my approach is correct.&lt;/P&gt;
&lt;P&gt;Please help .&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 08:25:20 GMT</pubDate>
    <dc:creator>Aspiring_Developer</dc:creator>
    <dc:date>2022-06-17T08:25:20Z</dc:date>
    <item>
      <title>Overwrite old data with the new one in Qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Overwrite-old-data-with-the-new-one-in-Qliksense/m-p/1944957#M77879</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I have below data :-&lt;/P&gt;
&lt;P&gt;[DATE_LABELS]:&lt;BR /&gt;LOAD DATEKEY AS DATE_LABELS.DATEKEY, &lt;BR /&gt;DATE(DATE#(DATEKEY,'YYYYMMDD'),'DD-MMM-YY') AS [REPORT DATE],&lt;BR /&gt;PERIOD_TYPE AS DATE_LABELS.PERIOD_TYPE, &lt;BR /&gt;DATE_LABEL, &lt;BR /&gt;THEDATE, &lt;BR /&gt;ENDDATE, &lt;BR /&gt;SORT_ORDER,&lt;BR /&gt;DATEKEY&amp;amp;PERIOD_TYPE AS DATE_LABEL_KEY;&lt;BR /&gt;SELECT "DATEKEY",&lt;BR /&gt;"PERIOD_TYPE",&lt;BR /&gt;"DATE_LABEL",&lt;BR /&gt;"THEDATE",&lt;BR /&gt;"ENDDATE",&lt;BR /&gt;"SORT_ORDER"&lt;BR /&gt;FROM "ENTERPRISE_EPR"."PPL_SBDB_DATE_LABELS";&lt;/P&gt;
&lt;P&gt;Now, in this&amp;nbsp; Report Date has data for 15th june and data is reloaded and stored into qvd. Now, when the data is reloaded next day, so it before loading it should check if the report_date has the data for 16 th june. if yes, the old data should be overwrite the new one , if not , no change should be there and the qvd should stick with the data for 15 june.&lt;/P&gt;
&lt;P&gt;Initially I was thinking to use incremental insert and update but it is not applicable in my case as I don't want the table to be loaded until the condition for date is met.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have done for far is :-&lt;/P&gt;
&lt;P&gt;1)I loaded the data table and stored it into qvd named History.qvd&amp;nbsp; and calculated max(date) and stored in in the variable like below :-&lt;/P&gt;
&lt;P&gt;Max:&lt;/P&gt;
&lt;P&gt;Load Max(Report _Date) as Max Date&lt;/P&gt;
&lt;P&gt;Resident Data Label&lt;/P&gt;
&lt;P&gt;Vmax = peek ('Max Date', Max )&amp;nbsp; &amp;nbsp;// this max date is calculated on the history.qvd&lt;/P&gt;
&lt;P&gt;Drop table Data Label&lt;/P&gt;
&lt;P&gt;2) secondly I again loaded Data label table and this time I only loaded&amp;nbsp; Date field and again calculated max(date) and stored into today .qvd&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, I what I am trying to do is create an if condition before the load of data label table that will check the maxdate of history .qvd and will check if it is greater than or equal to the maxdate calculated from today.qvd&lt;/P&gt;
&lt;P&gt;The problem I am facing here is how should I apply this if condition so that the data is only reloaded when the condition is met. Also, not sure if my approach is correct.&lt;/P&gt;
&lt;P&gt;Please help .&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:25:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Overwrite-old-data-with-the-new-one-in-Qliksense/m-p/1944957#M77879</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2022-06-17T08:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Overwrite old data with the new one in Qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Overwrite-old-data-with-the-new-one-in-Qliksense/m-p/1945027#M77884</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can create if condition in the similar way as you us it inside load statement, but with a bit different expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LET vMax1 = 1;
LET vMax2 = 1;


IF $(vMax1)&amp;lt;=$(vMax2) THEN

1:
load *inline 
[temp, 
1];

ELSE

2:
load *inline 
[temp, 
2];

END IF&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so your logic can be, to calculate Vmax from history.qvd (variable vMax1), calculate your max(date) from today.qvd and store it as variable too (vMax2). And inside IF condition compare them - if it is TRUE, THEN you load something you need, if ELSE you can go straight to END IF and do nothing, or do something else (as in example, load table '2').&amp;nbsp; Note, that IF and THEN words should be in one, same row, otherwise Qlik think it is an error. Hope you can use something of this for your solution.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 11:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Overwrite-old-data-with-the-new-one-in-Qliksense/m-p/1945027#M77884</guid>
      <dc:creator>justISO</dc:creator>
      <dc:date>2022-06-17T11:45:07Z</dc:date>
    </item>
  </channel>
</rss>

