1 Reply Latest reply: Feb 20, 2017 2:13 AM by Court van de Lisdonk RSS

    Expression with addmonths

    Court van de Lisdonk

      Hello

      I have a Qlikviewdocument  with different sheets with different charts.

      In one chart I use  the expression:

      = Sum({<YearMonth ={">=$(=date(addmonths(date#('$(sMonthYear)','MMM-YYYY'),-11),'MMM-YYYY')) <=$(=date#('$(sMonthYear)','MMM-YYYY'))"}, Year=,Month=>} ActualAmount) 

       

      This is the first column in the chart, represented by a mini Chart. The mini chart should show the Actual Amount of the last 12 months, this worked in 2016 but now in 2017 it is empty (see below)

       

      Year 2016.png

      Year 2017.png

       

      YearMonth is created in the calendar/script and can be from Jan-2014 till Dez-2017. When I selected 2017 as Year the  YearMonth-table shows Jan-2017 – Dez-2017. sMonthYear is at the moment  Feb-2017

      I have added two jpg files (screen shots of the Qlikview Document) with more information.

      I hope someone can tell me why the expression doesn’t work in 2017 and what could be the solution

      Thanks in advance

       

      Court 

        • Re: Expression with addmonths
          Court van de Lisdonk

          Hello,

           

          This issue is solved. Variables and other settings are loaded in every Qlikview document by a txt-file. A colleague has this txt file customized for his qlikview document without looking to other documents. Thereby certain variables (like sMonthYear) were no longer filled.

           

          Advisable, therefore is: always check the impact of changes on other Qlikview documents before making adjustments in common files (like a txt-file we use)

           

          Note: we use a txt-file so every Qlikview document has the same settings (like colours  etc).