Created
September 5, 2013 20:19
-
-
Save uded/6455599 to your computer and use it in GitHub Desktop.
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
SELECT | |
DATE_FORMAT(date_value, '{{ groupby }}') AS date_value, | |
SUM(values) AS sum | |
FROM | |
table | |
GROUP BY | |
date_value |
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
VARIABLE: { | |
name: "groupby", | |
display: "Aggregate by", | |
type: "select", | |
options: [ | |
{display: "Day", value: "%Y-%m-%d"}, | |
{display: "Calendar Week", value: "%Y CW %u"}, | |
{display: "Month", value: "%Y %M"}], | |
default: "Calendar Week" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment