getChange(String indicator, Object fromDate, Object toDate)

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 1분
  • Returns the change in the score of an indicator between two specified dates.

    표 1. Parameters
    Name Type Description
    indicator String Unique identifier of the indicator for which to calculate the change.
    fromDate Object Initial date of the comparison.
    toDate Object End date of the comparison.
    표 2. Returns
    Type Description
    Number Difference in the specified indicator score between the two dates.

    Change from the beginning of the month to the last collection period

    In this example, we have the indicator Number of open incidents, whose scores are collected daily. The fromDate parameter is the first second of the current month, constructed by taking the timestamp of the last collection period (score_start), extracting the year and the month from the timestamp, and appending the numeral 01 for the day. The toDate parameter is the timestamp of the beginning of the last collection period, which would be the first second of the previous day, depending on timezone differences.

    pa.getChange($[[Number of open incidents]], new GlideDateTime(score_start.getYear() + '-' + score_start.getMonth() + '-01'), score_start);