Chapter 3. Working with Time

In this chapter, we will cover the following recipes:

  • Calculating the Year-To-Date (YTD) value
  • Calculating the Year-over-Year (YoY) growth (parallel periods)
  • Calculating moving averages
  • Finding the last date with data
  • Getting values on the last date with data
  • Calculating today's date using the STRING functions
  • Calculating today's date using the MemberValue function
  • Calculating today's date using an attribute hierarchy
  • Calculating the difference between two dates
  • Calculating the difference between two times
  • Calculating parallel periods for multiple dates in a set
  • Calculating parallel periods for multiple dates in a slicer

Introduction

Time–handling features are an important part of every Business Intelligence (BI) system. Programming ...

Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.