Skip to main content
Creating Time Dimensions

How to create additional time dimensions

Updated over 3 weeks ago

As part of the core setup, several default time dimensions are already configured for you. These default dimensions are based on SQL queries. However, if you need additional time dimensions for your analysis, you can easily create and configure them.

Creating new time dimension:

  1. Create a new dimension

  2. On the 'Settings' tab, check the 'Universal' box

  3. Enter the appropriate SQL query for your time dimension in the provided field.

SQL Queries:

Date:
​DATE_FORMAT({DATE_SQL}, '%Y-%m-%d (%a)')

Day of Week:

DAYNAME({DATE_SQL})

Week Commencing:

CONCAT ('w/c ',DATE_FORMAT(FROM_DAYS(TO_DAYS({DATE_SQL}) - MOD (TO_DAYS({DATE_SQL}) -2, 7)),'%Y-%m-%d (%a)'))

Month:

MONTHNAME({DATE_SQL})

Quarter:

CONCAT('Q', QUARTER({DATE_SQL}))

Year:

YEAR({DATE_SQL})

Year Month:

DATE_FORMAT({DATE_SQL}, '%Y - %M')

Year Quarter:

CONCAT('Q', QUARTER({DATE_SQL}), ' ', DATE_FORMAT({DATE_SQL}, '%Y'))

Did this answer your question?