Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
anavin33
New Contributor II

Importing for a db2 database

So I'm trying to import from a database into qlikview. I am getting an error that OLTV cannot be found, but I have declared it in the SQL script (in red) and then I try to rename it (also in red).

Anyone know how to solve this problem? As to why I cannot declare something in the SQL script

//ML

//LTV

LTV:

Load

ACCT_NBR as acct_nbr;

OLTV as oltv;

sql select

(CASE WHEN DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT>0 AND DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT <DW.V_MORT_LOAN_ACCT.APPR_AMT THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT  / DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT  * 100

WHEN DW.V_MORT_LOAN_ACCT.APPR_AMT >0 THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT   / DW.V_MORT_LOAN_ACCT.APPR_AMT   * 100  ELSE 0 END   )    as OTLV

, DW.V_MORT_LOAN_ACCT.ACCT_NBR

from DW.V_MORT_LOAN_ACCT

where (DW.V_MORT_LOAN_ACCT.ACCT_STAT_CD = '1') and (DW.V_MORT_LOAN_ACCT.PROD_DT = (select MAX (DW.V_MORT_LOAN_ACCT.PROD_DT) from DW.V_MORT_LOAN_ACCT));

1 Solution

Accepted Solutions
Not applicable

Re: Importing for a db2 database

You SQL statement field name (OTLV) is different from LOAD statement Field Name (OLTV).

Try like below:

LTV:

Load

ACCT_NBR as acct_nbr;

OLTV as oltv;

sql select

(CASE WHEN DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT>0 AND DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT <DW.V_MORT_LOAN_ACCT.APPR_AMT THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT  / DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT  * 100

WHEN DW.V_MORT_LOAN_ACCT.APPR_AMT >0 THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT   / DW.V_MORT_LOAN_ACCT.APPR_AMT   * 100  ELSE 0 END   )    as OLTV

, DW.V_MORT_LOAN_ACCT.ACCT_NBR

from DW.V_MORT_LOAN_ACCT

where (DW.V_MORT_LOAN_ACCT.ACCT_STAT_CD = '1') and (DW.V_MORT_LOAN_ACCT.PROD_DT = (select MAX (DW.V_MORT_LOAN_ACCT.PROD_DT) from DW.V_MORT_LOAN_ACCT));

1 Reply
Not applicable

Re: Importing for a db2 database

You SQL statement field name (OTLV) is different from LOAD statement Field Name (OLTV).

Try like below:

LTV:

Load

ACCT_NBR as acct_nbr;

OLTV as oltv;

sql select

(CASE WHEN DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT>0 AND DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT <DW.V_MORT_LOAN_ACCT.APPR_AMT THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT  / DW.V_MORT_LOAN_ACCT.SALES_PRICE_AMT  * 100

WHEN DW.V_MORT_LOAN_ACCT.APPR_AMT >0 THEN DW.V_MORT_LOAN_ACCT.ORIG_AMT   / DW.V_MORT_LOAN_ACCT.APPR_AMT   * 100  ELSE 0 END   )    as OLTV

, DW.V_MORT_LOAN_ACCT.ACCT_NBR

from DW.V_MORT_LOAN_ACCT

where (DW.V_MORT_LOAN_ACCT.ACCT_STAT_CD = '1') and (DW.V_MORT_LOAN_ACCT.PROD_DT = (select MAX (DW.V_MORT_LOAN_ACCT.PROD_DT) from DW.V_MORT_LOAN_ACCT));

Community Browser