<?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: Max Day script to prevent duplicate loads on QVD in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770859#M59655</link>
    <description>&lt;P&gt;Please read once&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm" target="_blank"&gt;This&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Dec 2020 19:47:07 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2020-12-28T19:47:07Z</dc:date>
    <item>
      <title>Max Day script to prevent duplicate loads on QVD</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770848#M59652</link>
      <description>&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently have a scenario where we are loading 2 Sections. The first Section contains a QVD file with historical data up until the previous day, and the Second Section contains the newest day's data concatenated on top of the historical. We then store the historical and new concatenated data as the QVD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have been running into a problem where if the script is loaded more than once, the newest day's data is duplicated. Our script currently looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Section 1:&lt;/P&gt;&lt;P&gt;HISTORICAL:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Day",&lt;BR /&gt;"Location",&lt;BR /&gt;DOH,&lt;BR /&gt;"Drop-Ship",&lt;BR /&gt;"Ending Inventory",&lt;BR /&gt;ID,&lt;BR /&gt;"In Transit",&lt;BR /&gt;"Lost Sales",&lt;BR /&gt;"On Order",&lt;BR /&gt;"Product Code",&lt;BR /&gt;"Product Desc",&lt;BR /&gt;Receipts,&lt;BR /&gt;Sales,&lt;BR /&gt;"Location" &amp;amp; "Product Code" as WHProdKey&lt;BR /&gt;FROM [lib://QVD Storage (ngavin)/INVHISTORYBACKUP.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;Left Join (HISTORICAL)&lt;/P&gt;&lt;P&gt;Load Max("Day") as MaxDay Resident HISTORICAL;&lt;/P&gt;&lt;P&gt;Section 2:&lt;/P&gt;&lt;P&gt;Concatenate&lt;BR /&gt;NEW:&lt;BR /&gt;LOAD&lt;BR /&gt;"Day",&lt;BR /&gt;Product as "Product Desc",&lt;BR /&gt;"ProductC" as "Product Code",&lt;BR /&gt;"Location",&lt;BR /&gt;"VALUES - SUM(Ending Inventory C.U.)" as "Ending Inventory",&lt;BR /&gt;"VALUES - SUM(Ending On Order C.U.)" as "On Order",&lt;BR /&gt;"VALUES - DMADOH(DMA DOH C.U.)" as "DOH",&lt;BR /&gt;"VALUES - SUM(In Transit C.U.)" as "In Transit",&lt;BR /&gt;"VALUES - SUM(Lost Sales C.U.)" as "Lost Sales",&lt;BR /&gt;"VALUES - SUM(Sales C.U.)" as "Sales",&lt;BR /&gt;"VALUES - SUM(Receipts C.U.)" as "Receipts",&lt;BR /&gt;"VALUES - SUM(852 Drop Ship C.U.)" as "Drop-Ship",&lt;BR /&gt;"Location" &amp;amp; "Product" as WHProdKey&lt;BR /&gt;FROM [lib:// V2 (ngavin)]&lt;BR /&gt;(txt, utf8, embedded labels, delimiter is '\t', msq)&lt;/P&gt;&lt;P&gt;STORE HISTORICAL into [lib://QVD Storage (ngavin)/INVHISTORYBACKUP.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have been trying to use this "MaxDay" field to write script so the newest Day's data will only be loaded if it exceeds the latest Day present on the QVD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where "Day" &amp;gt; "MaxDay", but we receive an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any suggestions on how to accomplish this? Much appreciated for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nolan&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 18:56:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770848#M59652</guid>
      <dc:creator>Nolan</dc:creator>
      <dc:date>2020-12-28T18:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Max Day script to prevent duplicate loads on QVD</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770853#M59653</link>
      <description>&lt;P&gt;Create one varaible after you Max table like&lt;/P&gt;&lt;P&gt;LET vMaxDay = Peek('&lt;SPAN&gt;MaxDay&lt;/SPAN&gt;', 0, '&lt;SPAN&gt;HISTORICAL&lt;/SPAN&gt;');&lt;/P&gt;&lt;P&gt;Then try this way&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Where "Day" &amp;gt; '$(vMaxDay)',&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 19:18:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770853#M59653</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2020-12-28T19:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Max Day script to prevent duplicate loads on QVD</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770857#M59654</link>
      <description>&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this is still resulting in duplicates of our sales values. Any other suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 19:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770857#M59654</guid>
      <dc:creator>Nolan</dc:creator>
      <dc:date>2020-12-28T19:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Max Day script to prevent duplicate loads on QVD</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770859#M59655</link>
      <description>&lt;P&gt;Please read once&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm" target="_blank"&gt;This&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 19:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Day-script-to-prevent-duplicate-loads-on-QVD/m-p/1770859#M59655</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2020-12-28T19:47:07Z</dc:date>
    </item>
  </channel>
</rss>

