PASnapshot - getCompareQuery(String sys_id, Number date1, Number date2, String type)

Get the query used to compare records in snapshots for a specified indicator at multiple dates.

Table 1. Parameters
Name Type Description
sys_id String The indicator sys_id.
date1 Number The date of the first snapshot, in the format yyyymmdd.
date2 Number The date of the second snapshot, in the format yyyymmdd.
type String Specifies what data to retrieve. Valid values are:
  • all1: all records in the first snapshot
  • all2: all records in the second snapshot
  • shared: records that are in both snapshots
  • movedin: records that are in the second snapshot, but not the first
  • movedout: records that are in the first snapshot, but not the second
Table 2. Returns
Type Description
String The table, view, and encoded query as a JSON string.
var snapshot4 = PASnapshot.getCompareQuery('fb007202d7130100b96d45a3ce6103b4', 20160530, 20160531, 'all1');
gs.info(snapshot4);

Output: *** Script: {"view":"","query":"sys_idINjavascript:new PAUtils().getCompareSnapshotIDs(\"fb007202d7130100b96d45a3ce6103b4\",\"20160530\",\"20160531\",\"all1\")","table":"incident"}