Issue Description
When attempting data pivot with classic layout using custom data server api approach, the pivot chart aggregation is failing for "Sum of id". However, aggregation is working when Calculated Formula "FormulaSumId", which does sum("id"), is used instead.
Version Details
Attached Files Details
Extract the files from the attached zip file. Below are details of the files inside the zip file.
Data Server API (Example used)
api1: https://localhost:8080/flexmonster/data-server/handshake
api1 req: { "type": "handshake", "version": "2.9.124" }
api2 res: {"version":"2.9.124"}
api2: https://localhost:8080/flexmonster/data-server/fields
api2 req: { "index": "1712145", "type": "fields" }
api2 res: {"fields":[{"uniqueName":"filename","type":"string","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null},{"uniqueName":"id","type":"number","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null},{"uniqueName":"tablename","type":"string","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null},{"uniqueName":"operation","type":"string","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null},{"uniqueName":"command","type":"string","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null},{"uniqueName":"who","type":"string","caption":null,"hierarchy":null,"parent":null,"folder":null,"interval":null,"aggregations":[],"filters":null}],"aggregations":{"any":null,"date":["count","distinctcount"],"number":["sum","count","distinctcount","average","min","max"],"string":["count","distinctcount"]},"filters":true,"sorted":false}
api3: https://localhost:8080/flexmonster/data-server/members
api3 req: {"index":"1712145","type":"members","field":{"uniqueName":"operation"},"page":0}
api3 res: {"members":[{"id":"execution","value":"execution"},{"id":"file ops","value":"file ops"},{"id":"test console","value":"test console"}],"sorted":true,"pageTotal":1,"page":0,"nextPageToken":null}
api4: https://localhost:8080/flexmonster/data-server/members
api4 req: {"index":"1712145","type":"members","field":{"uniqueName":"filename"},"page":0}
api4 res: {"members":[{"id":"run","value":"run"},{"id":"test","value":"test"},{"id":"test 1","value":"test 1"},{"id":"test 2","value":"test 2"}],"sorted":true,"pageTotal":1,"page":0,"nextPageToken":null}
api5: https://localhost:8080/flexmonster/data-server/select
api5 req: {"type":"select","index":"1712145","query":{"aggs":{"by":{"rows":[{"uniqueName":"operation"}],"cols":[{"uniqueName":"filename"}]},"values":[{"func":"sum","field":{"uniqueName":"id"}}]}},"querytype":"select","page":0}
api5 res: {"fields":null,"hits":null,"aggs":[{"keys":{"filename":"test","operation":"file ops"},"values":{"id":{"sum":245}}},{"keys":{"filename":"test 1","operation":"test console"},"values":{"id":{"sum":235}}},{"keys":{"filename":"run","operation":"execution"},"values":{"id":{"sum":375}}},{"keys":{"filename":"test 1","operation":"file ops"},"values":{"id":{"sum":121}}},{"keys":{"filename":"test 2","operation":"test console"},"values":{"id":{"sum":239}}}],"pageTotal":1,"page":0,"nextPageToken":null}
Hello, Jun Jie!
Thank you for reaching out to us and for the detailed description of your use case.
Kindly note that Flexmonster expects to receive the totals data in /select response, even with the showTotals: off option enabled.
We have modified the provided /select response and included missing keys: https://jsfiddle.net/flexmonster/p9306qtf/.
Hope you will find our answer helpful.
Feel free to reach out to us in case of any other questions.
Kind regards,
Solomiia