Period

 

Foreword

See Postman example

p1 object is mandatory, it is the main period of analysis.

p2 object is optional, it describes the comparison period.

PARAMETERDESCRIPTIONPOSSIBLE VALUES
typeR(elative) or Absolute: D(ay), M(onth)
 

Absolute periods

Date format: yyyy-mm-dd

 

// Querying absolute periods:
"period": {
  "p1": [
    {
      "type": "D",
      "start": "2019-10-20",
      "end": "2019-10-24"
    }
  ],
  "p2": [
    {
      "type": "D",
      "start": "2019-10-15",
      "end": "2019-10-19"
    }
  ]
}

# Querying absolute periods:
"period": {
  "p1": [
    {
      "type": "D",
      "start": "2019-10-20",
      "end": "2019-10-24"
    }
  ],
  "p2": [
    {
      "type": "D",
      "start": "2019-10-15",
      "end": "2019-10-19"
    }
  ]
}

# Querying absolute periods:
"period": {
  "p1": [
    {
      "type": "D",
      "start": "2019-10-20",
      "end": "2019-10-24"
    }
  ],
  "p2": [
    {
      "type": "D",
      "start": "2019-10-15",
      "end": "2019-10-19"
    }
  ]
}

# Querying absolute periods:
"period": {
  "p1": [
    {
      "type": "D",
      "start": "2019-10-20",
      "end": "2019-10-24"
    }
  ],
  "p2": [
    {
      "type": "D",
      "start": "2019-10-15",
      "end": "2019-10-19"
    }
  ]
}

 

 

Relative periods

In the case of a single site call, the relative period will be in relation to the time zone of the site. In the case of a multi-site call, the relative period will be in relation to the most easterly time zone of the requested sites.

If you call a site A (UTC-1) and a site B (UTC+2), then the relative period will be relative to the site B.

PARAMETERDESCRIPTIONPOSSIBLE VALUES
granularityY(ear), Q(uarter), M(onth), W(eek), D(ay)
offSetNumber

// Querying relative periods:

"period": {
    "p1": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -1
      }
    ],
    "p2": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -2
      }
    ]
  }

# Querying relative periods:

"period": {
    "p1": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -1
      }
    ],
    "p2": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -2
      }
    ]
  }

# Querying relative periods:

"period": {
    "p1": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -1
      }
    ],
    "p2": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -2
      }
    ]
  }

# Querying relative periods:

"period": {
    "p1": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -1
      }
    ],
    "p2": [
      {
        "type": "R",
        "granularity": "D",
        "offset": -2
      }
    ]
  }

 

Last update: 04/05/2021