Created
June 12, 2012 22:56
-
-
Save Stiivi/2920669 to your computer and use it in GitHub Desktop.
Cubes: Mapping of date parts in date datatype columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cubes": [ | |
{ | |
"name": "example", | |
"measures": ["amount"], | |
"dimensions": ["date"], | |
"mappings": { | |
"date.year": {"column":"date", "extract":"year"}, | |
"date.month": {"column":"date", "extract":"month"}, | |
"date.day": {"column":"date", "extract":"day"} | |
} | |
} | |
], | |
"dimensions": [ | |
{ | |
"name":"date", | |
"levels": ["year", "month", "day"] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to SQLAlchemy sources, you can extract in most of the databases: 'month', 'day', 'year', 'second', 'hour', 'doy' (day of the year), 'minute', 'quarter', 'dow' (day of the week), 'week', 'epoch', 'milliseconds', 'microseconds', 'timezone_hour', 'timezone_minute'.