{"action":"opened","issue":{"url":"https://api.github.com/repos/RamblingCookieMonster/PSExcel/issues/26","repository_url":"https://api.github.com/repos/RamblingCookieMonster/PSExcel","labels_url":"https://api.github.com/repos/RamblingCookieMonster/PSExcel/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/RamblingCookieMonster/PSExcel/issues/26/comments","events_url":"https://api.github.com/repos/RamblingCookieMonster/PSExcel/issues/26/events","html_url":"https://github.com/RamblingCookieMonster/PSExcel/issues/26","id":147003500,"number":26,"title":"Add support for functions to PivotValues parameter in Export-XLSX","user":{"login":"replicaJunction","id":11758809,"avatar_url":"https://avatars.githubusercontent.com/u/11758809?v=3","gravatar_id":"","url":"https://api.github.com/users/replicaJunction","html_url":"https://github.com/replicaJunction","followers_url":"https://api.github.com/users/replicaJunction/followers","following_url":"https://api.github.com/users/replicaJunction/following{/other_user}","gists_url":"https://api.github.com/users/replicaJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/replicaJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/replicaJunction/subscriptions","organizations_url":"https://api.github.com/users/replicaJunction/orgs","repos_url":"https://api.github.com/users/replicaJunction/repos","events_url":"https://api.github.com/users/replicaJunction/events{/privacy}","received_events_url":"https://api.github.com/users/replicaJunction/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-08T18:31:12Z","updated_at":"2016-04-08T18:31:12Z","closed_at":null,"body":"Hi!\r\n\r\nI've needed to make a few PivotTables and associated graphs that need to use a summary function - for example, to count the number of occurrences of a single item.\r\n\r\nThe [ImportExcel module handles this](https://github.com/dfinke/ImportExcel/blob/master/Export-Excel.ps1#L283-L295) by accepting a variable-typed parameter for PivotData. It looks like to specify an alternate function, that module uses a hashtable instead of a String.\r\n\r\n```powershell\r\n# Count occurrences of each process name\r\ngps | Export-Excel @otherArguments -PivotData @{name='count'}\r\n```\r\n\r\nSince in this module, the PivotValues parameter in Add-PivotTable is defined as a String[], the same approach wouldn't work. Would a separate parameter be appropriate (something like PivotFunction)?\r\n\r\nI'm happy to submit a pull request for this if you'd like; I'd just need to do it from home instead of on my work machine. :)\r\n\r\nThanks!\r\n~replica\r\n\r\n"}}