Working with data ranges

Dataddo is able to define a dynamic date range relative to the current date.

When is the dynamic range needed?

Imagine a situation where date-related params must be defined as part of the API call.

If such a call is automated, the extracted dataset will always be the same, which is presumably not ideal. Both startDate and endDate params should be dynamically generated. This can be done using dynamic date range expressions such as follows.

How does it work?{{1m1}}&endDate={{1m1}}

The expression is enclosed in double curly brackets consists of three parts:

  1. The number at the start of expression 1m1. This represents the number of units (on this occasion, months) to go back from the current date and defines the start of the range. 0 represents the current value.
  2. Unit definition. d = day, m = month, w = week
  3. The last number sets the end of the range. 0 marks today, 1 marks yesterday, and so on. There is a rule that the first digit has to always be larger than the second one.


Expression examples

Expression Meaning
{{0d0}} Today
{{1d1}} Yesterday
{{1d0}} Yeasterday and today
{{0m0}} This month
{{1m1}} Last month
{{90d1}} Ninety days ago till yesterday
{{1w1}} Last week
{{0w0}} This week starting from monday
{{0y0}} This year
{{1y1}} Last year

API call with 'yesterday' date range{{1d1}}&endDate={{1d1}}

API call with 'this month' date range{{0m0}}&endDate={{0m0}}

Date string formatting

The date string is by default output as YYYY-MM-DD string (e.g. 2019-12-31). Unfortunately, not all APIs follow ISO 8601 standards. In such cases, it is possible to use a date string formating.

Custom formatting examples examples

Expression Output
{{0d0|Ymd}} 20201231
{{0d0|Y-m-d\TH:i:s}} 2020-12-31T00:00:00





How to change Date Range in Ad-hoc data load

Another case is that selecting DATE RANGE in the Ad-hoc data load panel is not possible. When this occurs, there is still a way to get your historical data. This process is a bit more advanced but feasible following this guide.