4 Replies Latest reply: Feb 20, 2012 10:59 AM by Wanda Norwood RSS

    Using a variable in a set expression

    Wanda Norwood

      Hello,

       

      I am new to QlikView and I am trying to do something I think should be easy, but I just can't seem to get it to work.  I want to use a variable in my set expression.  The variable (vslandYear) is set to the the value selected from a list box that uses a data island.

       

      When I use the actual year number like below, the expression works just fine.

      =sum({$<DateYear = {2008}>} Sales) 

       

      But, I want to it to work more like this:

      =sum({$<DateYear = {$(vIslandYear)}>} Sales)

       

      This results in all 0's in the results.  Can anyone tell me what I am doing wrong?

       

      Thanks!