{"action":"created","issue":{"url":"https://api.github.com/repos/square/crossfilter/issues/150","labels_url":"https://api.github.com/repos/square/crossfilter/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/square/crossfilter/issues/150/comments","events_url":"https://api.github.com/repos/square/crossfilter/issues/150/events","html_url":"https://github.com/square/crossfilter/issues/150","id":70753647,"number":150,"title":"Ability to create a (sub) dimension that when filtered does not propogate out its filter","user":{"login":"vmantese","id":10504414,"avatar_url":"https://avatars.githubusercontent.com/u/10504414?v=3","gravatar_id":"","url":"https://api.github.com/users/vmantese","html_url":"https://github.com/vmantese","followers_url":"https://api.github.com/users/vmantese/followers","following_url":"https://api.github.com/users/vmantese/following{/other_user}","gists_url":"https://api.github.com/users/vmantese/gists{/gist_id}","starred_url":"https://api.github.com/users/vmantese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmantese/subscriptions","organizations_url":"https://api.github.com/users/vmantese/orgs","repos_url":"https://api.github.com/users/vmantese/repos","events_url":"https://api.github.com/users/vmantese/events{/privacy}","received_events_url":"https://api.github.com/users/vmantese/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-24T18:00:44Z","updated_at":"2015-05-26T19:15:37Z","closed_at":"2015-05-26T19:15:37Z","body":"Say I have a dataset of people. It includes person's name, race,birthcity, and age.\r\n\r\nApplying filters across all dimensions is very useful, but sometimes we don't want that.\r\n\r\n I want to create a dimension on the data of people's birthcity. I want this particular dimension to filter in(include) only people from St. Louis. The thing is, I don't want this filter to affect the other dimensions(the reason I need a dimension and not a group is because i'm using dc.js dataTables. which does not accept groups). I need this dimension to have all the properties of a normal dimension EXCEPT for the fact that filters applied directly(in the declaration of this sub dimension) to the dimenson do not cross-affect other dimensions. Filters on normal dimensions should STILL filter on this 'sub' dimension. \r\n\r\nLet me know if anyone else has wanted something like this, yes I know groups can answer this issue but I need something with the same properties as a dimension EXCEPT outward propagating filters.\r\n\r\nIf I'm not the only one who wants this and if someone hasn't solved this problem already maybe I'll take a crack at it.\r\nThanks,\r\nV"},"comment":{"url":"https://api.github.com/repos/square/crossfilter/issues/comments/105638630","html_url":"https://github.com/square/crossfilter/issues/150#issuecomment-105638630","issue_url":"https://api.github.com/repos/square/crossfilter/issues/150","id":105638630,"user":{"login":"vmantese","id":10504414,"avatar_url":"https://avatars.githubusercontent.com/u/10504414?v=3","gravatar_id":"","url":"https://api.github.com/users/vmantese","html_url":"https://github.com/vmantese","followers_url":"https://api.github.com/users/vmantese/followers","following_url":"https://api.github.com/users/vmantese/following{/other_user}","gists_url":"https://api.github.com/users/vmantese/gists{/gist_id}","starred_url":"https://api.github.com/users/vmantese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmantese/subscriptions","organizations_url":"https://api.github.com/users/vmantese/orgs","repos_url":"https://api.github.com/users/vmantese/repos","events_url":"https://api.github.com/users/vmantese/events{/privacy}","received_events_url":"https://api.github.com/users/vmantese/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T19:15:37Z","updated_at":"2015-05-26T19:15:37Z","body":"Here is the solution I used. Works like a charm.\r\n\r\nfunction preFilter(dim,okey,oval){\r\n                   \r\n                    return{\r\n                        \r\n                        top:function(x1){\r\n                            var a1 = dim.top(x1).filter(function(v){\r\n                                return v[okey] === oval;\r\n                            });\r\n                            return a1;\r\n                        },\r\n                        filter:function(x2){\r\n                            dim.filter(x2);\r\n                        },\r\n                        filterAll:function(){\r\n                            dim.filterAll();\r\n                        },\r\n                        filterExact:function(x4){\r\n                            dim.filterExact(x4);\r\n                        },\r\n                        filterFunction:function(x5){\r\n                            dim.filterFunction(x5);\r\n                        },\r\n                        filterRange:function(x6){\r\n                            dim.filterRange(x6);\r\n                        },\r\n                        bottom:function(x7){\r\n                            dim.bottom(x7);\r\n                        },\r\n                        dispose:function(){\r\n                            dim.dispose();\r\n                        },\r\n                        group:function(x9){\r\n                            dim.group(x9);\r\n                        },\r\n                        groupAll:function(x10){\r\n                            dim.groupAll(x10);\r\n                        },\r\n                        remove:function(){\r\n                            dim.remove();\r\n                        }\r\n                    };\r\n                }"}}