# Date axis ranges & Predictive

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2020-12-16
- **Format:** Video · 13 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, datetrunc, filters, model quantile, table calculations)
- **Canonical:** https://just-tim.com/posts/extend-date-axis-range
- **Watch:** https://www.youtu.be/BNOkzCKVafE

I demonstrate the 2020.4 feature that lets you extend a continuous date axis beyond the values in your data set. I show that it only works with table calculations, predictive modelling functions and R/Python, walking through a moving average example and then a MODEL_QUANTILE predictive model.

## Key takeaways

- Extending the date axis range only works with supported calculations: predictive modelling functions, table calculations like moving average and running total, and R/Python functions
- With a moving average the number of nulls differs from the extension period because the calculation looks back over previous values, offsetting the deficit
- When using MODEL_QUANTILE you must wrap the order date in a date truncation (DATETRUNC) and an ATTR to avoid mixing aggregate and non-aggregate arguments
- The 'infer properties from missing values' option under Analysis must be ticked, otherwise the predictive model just draws a flat line into the future
- The custom Show Future Values option lets you push the forecast further, but with too little data it becomes an unrealistic exponential curve, so common sense still applies

## Chapters

- 0:00 Feature overview and caveats
- 0:32 Building a basic date chart
- 1:51 Show future values with moving average
- 2:44 Understanding nulls versus extension period
- 3:54 Setting up the predictive model
- 5:28 Writing the MODEL_QUANTILE calculation
- 9:09 Extending the axis and inferring missing values
- 10:26 Custom range limits and closing thoughts

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/extend-date-axis-range

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
