6 Replies Latest reply: Apr 29, 2011 4:16 PM by Forestell RSS

    Using variables within variables


      I am trying to imbed variables within a variable to dynamically limit an average calculation to certain years in the database.

      For example, when I place

      =avg( {1<Year={2009,2010,2011}>} Days_Lost)
      in a variable named CurrentYear, it will give me the average days lost for just the three years 2009, 2010, and 2011. I created three variables, vMaxYrR1, vMaxYrR2, and vMaxYrR3, where I place
      =Max (sig_closeYr,1),=Max (sig_closeYr,2), and =Max (sig_closeYr,3)
      respectively in the three variables. I then changed CurrentYear to read
      =avg( {1<Year={vMaxYrR1, vMaxYrR2, vMaxYrR3}>} Days_Lost)
      . This does not produce any results. Can anyone suggest a resolution to this?

      I am new to QlikView and would really appreciate your help.