1 Reply Latest reply: Jul 28, 2014 11:21 AM by Srikanth P RSS

    Importing for a db2 database

    Ashley Navin

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

        • Re: Importing for a db2 database
          Srikanth P

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