Search code examples
datetimepentahokettlesystem-information

Pentaho: Get System info - get previous month


As the title suggest, I would like to get the previous month using the given month from Get System Info. I used Get System Info step to get todays month and year, and from there I would like to get the previous month. This is so it would be dynamic and I can ran this any day and still get the correct filter rather than making a hard coded year and month. Is this possible? If so, how do I do that?


Solution

  • Here is how I did it. This is the overview

    enter image description here

    Here is the calculator:

    enter image description here

    And concatenate fields:

    enter image description here

    There is still a few loop hole on getting the previous month during January. But, that is how I did it.