1 Reply Latest reply: Apr 16, 2018 8:37 AM by Petter Skjolden RSS

    if logic help

    P Kumar

      Hi Experts,


      Can any one please help me to apply the below four oracle logics in to Qlik.


           nvl(a.datasecurityid, b.datasecurityid)               as datasecurityid,

            nvl(a.riskfactorid, b.riskfactorid)                        as riskfactorid,

            decode(p_reportSource, 'a', b.plvametricid,

                                   'b', b.sensbasedpnlmetricid,

                                   nvl(a.pnlMetricid, b.sensbasedpnlmetricid))      as     pnlMetricid,

            nvl(p_reportSource, nvl(a.reportsource, 'b'))                             as reportSource



      Thanks in advance.



      Could you please help me on this.

        • Re: if logic help
          Petter Skjolden

          The Qlik Alt() function will work very similar to the Oracle NVL() function.


          The combination of Pick() and Match could work similar to the Oracle DECODE.


          So I think this should be very close to what you need:


               Alt( a.datasecurityid , b.datasecurityid )     AS datasecurityid,

               Alt( a.riskfactorid , b.riskfactorid )               AS riskfactorid,

               Pick( Match( p_reportSource ,  'a' , 'b' ) + 1

                   , Alt( a.pnlMetricid, b.sensbasedpnlmetricid )

                   , b.plvametricid

                   , b.sensbasedpnlmetricid

              ) AS pnlMetricid,

              Alt( p_reportSource , a.reportsource , 'b' ) AS reportSource