3 Replies Latest reply: Nov 23, 2015 6:11 PM by Andrew Walker RSS

    if statement in qlikview

      how can we write this if statement in qlikview



      If "Collateral or Scrip" = "Trades" And
      If "Borrower or Lender" = "Lender" Then
      Market Value = -Qty * Market Price Else
      Market Value = Qty * Market Price

      If "Collateral or Scrip" = "Collateral" and "Security ID" = "Cash"
      Then If "Borrower or Lender" = "Borrower"
      Market Value = -Qty Else
      Market Value = Qty

      ElseIf "Security ID" <> "Cash" and
      "Borrower or Lender" = "Borrower" Then
      Market Value = -Qty *  Market Price Else
      Market Value = Qty * Market Price

        • Re: if statement in qlikview
          Marco Wedel

          please post sample application.

           

          regards

           

          Marco

          • Re: if statement in qlikview
            Celambarasan Adhimulam

            May be like this

            Load *,

            If("Collateral or Scrip" = "Trades",

                 If ("Borrower or Lender" = "Lender",

                            -Qty * "Market Price",

                           Qty * "Market Price"

                 ),

                 If( "Collateral or Scrip" = "Collateral" and "Security ID" = "Cash",

                      If( "Borrower or Lender" = "Borrower",

                                -Qty,

                                Qty

                      ),

                      If( "Security ID" <> "Cash" and "Borrower or Lender" = "Borrower",

                                -Qty *  "Market Price",

                                Qty * "Market Price"

                      )

                 )

            ) AS Market Value

            FROM Source;

            • Re: if statement in qlikview
              Andrew Walker

              Try this:

               

              Pick(Match([Collateral or Scrip],'Trades','Collateral'),

              //[Collateral or Scrip] ='Trades'

              If([Borrower or Lender] = 'Lender',[Market Value] = -Qty * [Market Price], [Market Value] = Qty * [Market Price])

              ,

              //[Collateral or Scrip] ='Collateral'

              If([Security ID] = 'Cash',

              If([Borrower or Lender] = 'Borrower', [Market Value] = -Qty, [Market Value] = Qty),

              If([Borrower or Lender] = 'Borrower', [Market Value] = -Qty * [Market Price], [Market Value] = Qty * Market Price)