{"action":"created","issue":{"url":"https://api.github.com/repos/EverythingMe/redash/issues/610","labels_url":"https://api.github.com/repos/EverythingMe/redash/issues/610/labels{/name}","comments_url":"https://api.github.com/repos/EverythingMe/redash/issues/610/comments","events_url":"https://api.github.com/repos/EverythingMe/redash/issues/610/events","html_url":"https://github.com/EverythingMe/redash/pull/610","id":111254931,"number":610,"title":"dimension support on charts","user":{"login":"tjwudi","id":5257816,"avatar_url":"https://avatars.githubusercontent.com/u/5257816?v=3","gravatar_id":"","url":"https://api.github.com/users/tjwudi","html_url":"https://github.com/tjwudi","followers_url":"https://api.github.com/users/tjwudi/followers","following_url":"https://api.github.com/users/tjwudi/following{/other_user}","gists_url":"https://api.github.com/users/tjwudi/gists{/gist_id}","starred_url":"https://api.github.com/users/tjwudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjwudi/subscriptions","organizations_url":"https://api.github.com/users/tjwudi/orgs","repos_url":"https://api.github.com/users/tjwudi/repos","events_url":"https://api.github.com/users/tjwudi/events{/privacy}","received_events_url":"https://api.github.com/users/tjwudi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-13T19:42:55Z","updated_at":"2015-10-14T08:40:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/EverythingMe/redash/pulls/610","html_url":"https://github.com/EverythingMe/redash/pull/610","diff_url":"https://github.com/EverythingMe/redash/pull/610.diff","patch_url":"https://github.com/EverythingMe/redash/pull/610.patch"},"body":"So just as discussed with @arikfr via email ...\r\n\r\nDimensions is a set of features that data has. For example, let's say we have a query pulling UV of yelp.com from database.\r\n\r\n```\r\nSELECT time, COUNT(*) FROM uv_records\r\nGROUP BY time\r\n```\r\n\r\nOften times the data should have many other properties. For example, for a single UV, let's say we magically know the user's gender. So now we have a query like this.\r\n\r\n```\r\nSELECT time, gender, COUNT(*) FROM uv_records\r\nGROUP BY time, gender\r\n```\r\n\r\nThe result cannot be shown as a chart in re:dash since, for every single date, we have multiple rows (points) corresponding to it. So the idea of dimension is here to help. A dimension is a certain property of data that can re-group current data into several groups. In our data, we can have two values (M, F) for gender, so if we use gender as a dimension, then we can have two groups of data. \r\n\r\nHere is a screenshot of how dimensions are set (not from the UV example though).\r\n\r\nOnce you have dimensions set up, you can view your data from different dimensions. So here is an example of the chart without applying any dimension.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5257816/10466184/b39a0ef8-71a7-11e5-9bac-d4b01ebbc655.png)\r\n\r\nHere we have two dimensions, has_canonical and is_indexable. Because we don't have any dimension enabled yet, the chart will still contain one series.\r\n\r\nNow here is the fun part, we can turn on one of the dimensions and see the data being split into multiple series.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5257816/10466189/bd6c1962-71a7-11e5-9b46-f3cffd3ab633.png)\r\n\r\nBTW I also added **.editorconfig** for the sake of making code more consistent. If you don't think it's a good idea to have it here, feel free to tell me so I can pull it out.\r\n"},"comment":{"url":"https://api.github.com/repos/EverythingMe/redash/issues/comments/147975312","html_url":"https://github.com/EverythingMe/redash/pull/610#issuecomment-147975312","issue_url":"https://api.github.com/repos/EverythingMe/redash/issues/610","id":147975312,"user":{"login":"landscape-bot","id":10010231,"avatar_url":"https://avatars.githubusercontent.com/u/10010231?v=3","gravatar_id":"","url":"https://api.github.com/users/landscape-bot","html_url":"https://github.com/landscape-bot","followers_url":"https://api.github.com/users/landscape-bot/followers","following_url":"https://api.github.com/users/landscape-bot/following{/other_user}","gists_url":"https://api.github.com/users/landscape-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/landscape-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landscape-bot/subscriptions","organizations_url":"https://api.github.com/users/landscape-bot/orgs","repos_url":"https://api.github.com/users/landscape-bot/repos","events_url":"https://api.github.com/users/landscape-bot/events{/privacy}","received_events_url":"https://api.github.com/users/landscape-bot/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T08:40:16Z","updated_at":"2015-10-14T08:40:16Z","body":"[![Code Health](https://landscape.io/badge/235771/landscape.svg?style=flat)](https://landscape.io/diff/223175)\nRepository health decreased by 0.17% when pulling **[1d3abb2](https://github.com/tjwudi/redash/commit/1d3abb20e2f80df9a6b7ce85d6e827707b09c9c6) on tjwudi:diwu/feature/dimension-support** into **[9e183f1](https://github.com/EverythingMe/redash/commit/9e183f15008314e233a975913d2eb02e6b6bc0d9) on EverythingMe:master**.\n\n * [14 new problems were found](https://landscape.io/diff/223175) (including 0 errors and 14 code smells).\n * [17 problems were fixed](https://landscape.io/diff/223175/fixed) (including 1 error and 16 code smells)."}}