<?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 inputfield and reload failure after database update in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/inputfield-and-reload-failure-after-database-update/m-p/366789#M136412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting and successfully have been able to create a QV document which allows me to update MS SQL database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Load data from Database&lt;/P&gt;&lt;P&gt;2. Allow user to modify the data using inputfield&lt;/P&gt;&lt;P&gt;3. Export CSV file of changes&lt;/P&gt;&lt;P&gt;4. Execute a perl script to update SQL database&lt;/P&gt;&lt;P&gt;5. Reload database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INPUTFIELD Units;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INPUTFIELD Dollars;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;ODBC CONNECT STATMENT&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForecastType,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuyerCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Units,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Units as Units.Saved,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dollars,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dollars as Dollars.Saved,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo() as RowCount;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM ForecastTest;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;The QV form has a table with ForecastType, CustomerCode, BuyerCode, Year and Month as dimensions. The expressions are Units Saved: sum(Units.Saved), Update Units: &lt;/SPAN&gt;InputSum(Units, '*') and UpdateFlag: if([Update Units]&amp;lt;&amp;gt; [Units Saved],1,0)&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;. I have another table (updateForecast) with exact same dimensions and Units: If(Sum(Units.Saved)&amp;lt;&amp;gt;Sum(Units), Sum(Units)) as expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a button that first exports the data from UpdateForecast table and executes an external perl script to update the SQL database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this works. The problem is that once the update is done when I try to reload the data, the reload fails by "Execution of script Failed!" and the view closes. When I re-open the QVW file and hit reload everything is back to normal with updated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS: This work was based on &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" href="http://community.qlik.com/docs/DOC-2784"&gt;http://community.qlik.com/docs/DOC-2784&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 04:41:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-24T04:41:26Z</dc:date>
    <item>
      <title>inputfield and reload failure after database update</title>
      <link>https://community.qlik.com/t5/QlikView/inputfield-and-reload-failure-after-database-update/m-p/366789#M136412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting and successfully have been able to create a QV document which allows me to update MS SQL database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Load data from Database&lt;/P&gt;&lt;P&gt;2. Allow user to modify the data using inputfield&lt;/P&gt;&lt;P&gt;3. Export CSV file of changes&lt;/P&gt;&lt;P&gt;4. Execute a perl script to update SQL database&lt;/P&gt;&lt;P&gt;5. Reload database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INPUTFIELD Units;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INPUTFIELD Dollars;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;ODBC CONNECT STATMENT&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForecastType,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuyerCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Units,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Units as Units.Saved,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dollars,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dollars as Dollars.Saved,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo() as RowCount;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM ForecastTest;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;The QV form has a table with ForecastType, CustomerCode, BuyerCode, Year and Month as dimensions. The expressions are Units Saved: sum(Units.Saved), Update Units: &lt;/SPAN&gt;InputSum(Units, '*') and UpdateFlag: if([Update Units]&amp;lt;&amp;gt; [Units Saved],1,0)&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;. I have another table (updateForecast) with exact same dimensions and Units: If(Sum(Units.Saved)&amp;lt;&amp;gt;Sum(Units), Sum(Units)) as expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a button that first exports the data from UpdateForecast table and executes an external perl script to update the SQL database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this works. The problem is that once the update is done when I try to reload the data, the reload fails by "Execution of script Failed!" and the view closes. When I re-open the QVW file and hit reload everything is back to normal with updated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS: This work was based on &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" href="http://community.qlik.com/docs/DOC-2784"&gt;http://community.qlik.com/docs/DOC-2784&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 04:41:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/inputfield-and-reload-failure-after-database-update/m-p/366789#M136412</guid>
      <dc:creator />
      <dc:date>2012-05-24T04:41:26Z</dc:date>
    </item>
  </channel>
</rss>

