13 Replies Latest reply: Dec 29, 2014 9:45 AM by Raj Narayan RSS

    Case statement Replacement

      Hi,

       

      In my application so many CASE statements have been used to extract the data from database at script level. But today I got requirement that need to replace CASE statements with qlikview functions. But I am not able to find that. Could you please some one help me?

       

      EX:

      CASE WHEN A.N_ACRONYM = B.N_ACRONYM THEN 0 ELSE A.EAD END as EAD_WA

       

       

      CASE WHEN CLOSEOUT_AGREEMENT_NUMBER = '0' THEN A.EAD ELSE A.NET_EAD END AS EAD,
           A.EAD_M_UNCAPPED ,


           CASE WHEN CLOSEOUT_AGREEMENT_NUMBER = '0' THEN A.EAD_UK ELSE A.NET_EAD_UK END AS

       

      CASE WHEN A.N_ACRONYM = B.N_ACRONYM THEN 0 ELSE A.PD_FLOOR END as PD_FLOOR_WA,
           CASE WHEN A.N_ACRONYM = B.N_ACRONYM THEN 0 ELSE A.EAD END as EAD_WA,
           CASE WHEN A.N_ACRONYM = B.N_ACRONYM THEN 0 ELSE A.LGD END as LGD_WA

       

      CASE WHEN CLOSEOUT_AGREEMENT_NUMBER = '0' THEN A.EAD ELSE A.NET_EAD END AS EAD,
           A.EAD_M_UNCAPPED ,
           CASE WHEN CLOSEOUT_AGREEMENT_NUMBER = '0' THEN A.EAD_UK ELSE A.NET_EAD_UK END AS EAD_UK ,

       

      Thank you