{"action":"created","issue":{"url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/274","labels_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/274/comments","events_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/274/events","html_url":"https://github.com/nicolaskruchten/pivottable/issues/274","id":53994698,"number":274,"title":"Pivot() with data coming from a JSON and exporting current state of pivottable","user":{"login":"sunnypatel165","id":9017668,"avatar_url":"https://avatars.githubusercontent.com/u/9017668?v=3","gravatar_id":"","url":"https://api.github.com/users/sunnypatel165","html_url":"https://github.com/sunnypatel165","followers_url":"https://api.github.com/users/sunnypatel165/followers","following_url":"https://api.github.com/users/sunnypatel165/following{/other_user}","gists_url":"https://api.github.com/users/sunnypatel165/gists{/gist_id}","starred_url":"https://api.github.com/users/sunnypatel165/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunnypatel165/subscriptions","organizations_url":"https://api.github.com/users/sunnypatel165/orgs","repos_url":"https://api.github.com/users/sunnypatel165/repos","events_url":"https://api.github.com/users/sunnypatel165/events{/privacy}","received_events_url":"https://api.github.com/users/sunnypatel165/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-11T15:27:52Z","updated_at":"2015-01-18T17:39:35Z","closed_at":null,"body":"First of all, this is a superb utility. A big Thanks for making this:)\r\n\r\nNeed help on these 2 matters:\r\nSo, i have an internal dashboard for my company\r\n\r\n1. On the homepage i just want a summary, ie no customization options for the table( the customizable-PivotUI() tables will be under dedicated tabs).\r\n\r\nSo, on the home page i simply want a table with:\r\n<code>\r\n                        cols: [\"Week\"], <br>\r\n                        rows: [\"category\"],<br>\r\n                        aggregatorName: \"intSum\",<br>\r\n                        vals: [\"live_listings\"],<br>\r\n                        rendererName: \"Table\"<br>\r\n</code>\r\n\r\nThis is easily done in PivotUI.\r\nBut all i want is a simple table as shown in \"simple.html\" but data coming from JSON and not defined in the code within [ and ]. Is there a way to import JSON data with Pivot()?\r\n\r\nAnd 2nd: Also, when somebody uses customizable options to reach particular state, is there a way by which  we can allow the user to download/export/save table in that format? i mean the data will obviously come from my own database, but i want user to be able to store the snapshot of the table(not a screenshot of course) into a CSV or any excel format?\r\n\r\nPlease help.\r\nThanks."},"comment":{"url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/comments/70417308","html_url":"https://github.com/nicolaskruchten/pivottable/issues/274#issuecomment-70417308","issue_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/274","id":70417308,"user":{"login":"nicolaskruchten","id":203523,"avatar_url":"https://avatars.githubusercontent.com/u/203523?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaskruchten","html_url":"https://github.com/nicolaskruchten","followers_url":"https://api.github.com/users/nicolaskruchten/followers","following_url":"https://api.github.com/users/nicolaskruchten/following{/other_user}","gists_url":"https://api.github.com/users/nicolaskruchten/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaskruchten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaskruchten/subscriptions","organizations_url":"https://api.github.com/users/nicolaskruchten/orgs","repos_url":"https://api.github.com/users/nicolaskruchten/repos","events_url":"https://api.github.com/users/nicolaskruchten/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaskruchten/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T17:39:35Z","updated_at":"2015-01-18T17:39:35Z","body":"OK. You're mixing up `aggregators` and `aggregatorTemplates`. \r\n\r\nHere's the line you need if you want to use the predefined english-locale \"Integer Sum\":\r\n\r\n```javascript\r\naggregator: $.pivotUtilities.aggregators[\"Integer Sum\"]([\"properties_added\"])\r\n```\r\n\r\nIf you want to be able to control formatting you can use:\r\n\r\n```javascript\r\naggregator: $.pivotUtilities.aggregatorTemplates.sum()([\"Age\"])`\r\n```\r\n\r\nwhile passing in a formatting function into the `sum()` call to e.g. get integers only. \r\n\r\nThe \"Integer Sum\" aggregator is itself defined using the `sum()` aggregator template."}}