1 Reply Latest reply: May 20, 2014 5:03 PM by Antoine Frangieh RSS

    Set Variables for Current Year and Month

    Josh Campbell

      Just wanted to share something I created recently for a project in QlikView 11. I need to store in Variables the current Year and Month. For comparison purposes I decided to also store the previous year too. First create the following Variables:

      1. "vYear_Current"

      2. "vYear_Previous"
      3. "vMonth_Current"

       

      Then add the following to your Load Script

      LET vYear_Current = Year(Today());

      LET vYear_Previous = Year(Today()) -1;

      LET vMonth_Current = Month(Today());

       

      Once you refresh the QVW those variables will populate with the current year, current month and previous year values based on the date of the local computer or server.