Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Author

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));

View solution in original post

1 Reply
Not applicable
Author

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));