3 Replies Latest reply: Jun 14, 2012 9:44 AM by Miguel Angel Baeyens de Arce RSS

    Set Year Variable in Load Script

    Josh Campbell

      I have a QVW wherein several objects use one of three variables either when displaying information or when calculating expressions:

      1. vYear_Current

      2. vYear_Previous

      3. vYear_PreviousX2

       

      I want to have these variables set to the appropriate values when data is loaded into the file. For example, if I loaded data today I would want:

      vYear_Current = "2012"

      vYear_Previous = "2011"

      vYear_PreviousX2 = "2010"

       

      I tried using the following in my load script but it did not work:

      SET vYear_Current = YEAR(now());

      SET vYear_Current = YEAR(now(-1));

      SET vYear_Current = YEAR(now(-2));

       

      Any ideas?

       

      Thanks,

      Josh