<?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: Incremental load based on a date and flag in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530486#M689042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way i see it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume - you are extracting data from a DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First time the extract runs, You can take a Count(Transaction) and store that to a variable.Lets say something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let CountofTransactions = NoOfRows('DataTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when the second time the extarct runs, first tale a count of records of that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check:&lt;/P&gt;&lt;P&gt;SQL SELECT COUNT(1)&amp;nbsp; as COUNTCHECK FROM DB.TABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET DBTableRowCount = Peek('COUNTCHECK', 0, 'Check');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(DBTableRowCount) &amp;gt; $(CountofTransactions) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Extract Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the extracts again count the records in the updated table and update this variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let CountofTransactions = NoOfRows('DataTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ExtractCheck = "There is no new data available to Extract";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2013 14:34:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-11-15T14:34:38Z</dc:date>
    <item>
      <title>Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530483#M689039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have an incremental load set up in my script where I add the new months data when it becomes available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I have (2) issues:...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I need something in my script that says run the new data when it becomes available (so for example on December 1 November's data is available so do the incremental load - but it is not always available on the 1st of the month)&lt;/P&gt;&lt;P&gt;2. We rerun our script every night so once #1 (above) runs the new months data I don't want to run it again until the next months data becomes available (December).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to do this in an automated fashion so the users never have to touch the script...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 13:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530483#M689039</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-11-15T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530484#M689040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope i have understood your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, How do you identify if the November data is available or not. Is there a field value that you check, if so. Then you can set a variable or something, lets say if the first data check completes and data is available then set the variable to "1" else to "0". And the remaining part of the script will only run if the variable value is one else it will not. This way even if you schedule the job to run every night, the job would complete it just few seconds if the data is not there and if its there it would extract the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 13:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530484#M689040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-15T13:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530485#M689041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* The November data SHOULD be available on the 1st of December. However I can't count on that because it might be on the 2nd or 3rd of December.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still confused how to (1) identify when the new months data is ready and (2) how do you set the variable to "1" or "0" - I have never done that before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 14:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530485#M689041</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-11-15T14:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530486#M689042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way i see it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume - you are extracting data from a DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First time the extract runs, You can take a Count(Transaction) and store that to a variable.Lets say something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let CountofTransactions = NoOfRows('DataTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when the second time the extarct runs, first tale a count of records of that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check:&lt;/P&gt;&lt;P&gt;SQL SELECT COUNT(1)&amp;nbsp; as COUNTCHECK FROM DB.TABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET DBTableRowCount = Peek('COUNTCHECK', 0, 'Check');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(DBTableRowCount) &amp;gt; $(CountofTransactions) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Extract Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the extracts again count the records in the updated table and update this variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let CountofTransactions = NoOfRows('DataTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ExtractCheck = "There is no new data available to Extract";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 14:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530486#M689042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-15T14:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530487#M689043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create the Materialized View in you DB, and this having only MonthName &amp;amp; NooFRows field.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Before loading the Main table, Load above Materialized view and validate the Dec Month having rows or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If rows exist continue loading the data otherwise exist the script. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 14:38:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530487#M689043</guid>
      <dc:creator />
      <dc:date>2013-11-15T14:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530488#M689044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dathu.qv is right.&amp;nbsp; The key is doing this based on a date comparison.&amp;nbsp; Your nightly job still runs, but it only runs through to complete script if the date condition is met. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do this with loads from Salesforce.&amp;nbsp; See the attached script example.&amp;nbsp; Each row of the Salesforce.com dataset has a date stamp indicating when it was created/inserted.&amp;nbsp; In a nutshell my nightly script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Checks the existing QV table - finds the MAX(QV_CreateDate)&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Checks the live Salesforce.com table - finds the MAX(SFDC_CreateDate)&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Compares them to each other and creates a dynamic SQL Where clause to only pull the rows where MAX(QVCreateDate) &amp;lt; MAX(SFDC_CreateDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your purposes, you can modify #3 to simply check today's date, instead of checking the DB directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; the attached script is a little more elaborate, but should help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 17:29:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530488#M689044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-15T17:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Incremental load based on a date and flag</title>
      <link>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530489#M689046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 17:49:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Incremental-load-based-on-a-date-and-flag/m-p/530489#M689046</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2013-11-15T17:49:16Z</dc:date>
    </item>
  </channel>
</rss>

