7 Replies Latest reply: Apr 20, 2016 11:16 AM by Krishna Chaitanya RSS

    syntax to add a condition

    Larisa Romanov

      Hi all,

      I need to add a condition to a field which is part of the LINKKEY field (Not sure why initially in one qvd LINKKEY is defined in LOAD part and in another in SELECT part).

      QVD1---------------------------------------------------------------------------------------

      condition to add:

                 if D_ASSET_TYPE = '005' and A_DEPT < '1000' then A_DEPTFUNC = '000'

       

      QVD1:

      LOAD
      A_DEPT,
      F_FUND,
      A_DEPTFUNC,
      D_ASSET_TYPE,
      A_SUBDEPT,
      LINKKEY;

      SQL SELECT
      A_DEPT,
      F_FUND,
      A_DEPTFUNC,
      D_ASSET_TYPE,
      A_SUBDEPT,
      A_DEPT || '-' || F_FUND || '-' || A_DEPTFUNC || '-' || D_ASSET_TYPE || '-' || A_SUBDEPT as LINKKEY
      FROM YYYY;

      store QVD1 into '..\QVDs\QVD1.qvd';


      QVD2---------------------------------------------------------------------------------------

      condition to add:

                  if ASSET_TYPE = '005' and DEPT < '1000' then DEPTFUNC = '000'

       

      QVD2:
      LOAD
          DEPT,
          DEPTFUNC,
          DEPT & '-' & FUND & '-' & DEPTFUNC & '-' & ASSET_TYPE & '-' & SUBDEPT as LINKKEY,
          DEPT & '-' & DEPTFUNC & '-' & SUBDEPT as DEPTPROJKEY,
      SQL SELECT
           DEPT,
           DEPTFUNC,
      FROM AAAA;
      store QVD2 into '..\QVDs\QVD2.qvd';

       

      Thanks, appreciate your help