Variables with Parameters

    Hi Qlikers,

     

    I have been going through certain requirements in my current project which helped me to find variables with parameters.

    Syntax:

    if($1 = <value1>, expression1, if($1 = <value2>, expression2.......))))

     

    Note : We can also use multiple parameters of different data types and can be referred with $1, $2.....,$n.

     

     

    Steps  to create:

    -> Create a variable in settings-> variable overview

    -> Add a variable in the variable overview editor

    -> In the definition area create if conditions with above syntax.

     

     

    Usage:

    ->$(variablename(parameter 1, parameter2...parameter3...parametern))

     

     

    PFA qvw file which contains a variable with a single parameter : The first value calculates Savings and the second value calculates Savings%.

     

    Note: Although this feature is powerful , the variable editor shows "error"  or "underlines" in red which is a bug in Qlikview, please check the variable in a text box or in an expression for its validity.

     

    Regards

    Kiran Kumar