Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

inputfield and reload failure after database update

Hi all,

I'm attempting and successfully have been able to create a QV document which allows me to update MS SQL database.

Here is my idea:

1. Load data from Database

2. Allow user to modify the data using inputfield

3. Export CSV file of changes

4. Execute a perl script to update SQL database

5. Reload database

The code is as follows:

INPUTFIELD Units;

INPUTFIELD Dollars;

<ODBC CONNECT STATMENT>;

LOAD

    ForecastType,

    Year,

    Month,

    CustomerCode,

    BuyerCode,

    Units,

    Units as Units.Saved,

    Dollars,

    Dollars as Dollars.Saved,

    RowNo() as RowCount;

SQL SELECT *

FROM ForecastTest;

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: InputSum(Units, '*') and UpdateFlag: if([Update Units]<> [Units Saved],1,0) . I have another table (updateForecast) with exact same dimensions and Units: If(Sum(Units.Saved)<>Sum(Units), Sum(Units)) as expression.

I have a button that first exports the data from UpdateForecast table and executes an external perl script to update the SQL database.

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.

Any help is greatly appreciated.

Grif

PS: This work was based on http://community.qlik.com/docs/DOC-2784

0 Replies