Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pawwy1415
Creator III
Creator III

if logic help

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.

petter-s

Could you please help me on this.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

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


View solution in original post

1 Reply
petter
Partner - Champion III
Partner - Champion III

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