Skip to content

Commit

Permalink
Fix #4: count to behave like sum for totals
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Nov 12, 2018
1 parent 8d5c573 commit b8f94d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
build/
package-lock.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "LightPivotTable",
"author": "ZitRo",
"version": "1.8.12",
"version": "1.8.13",
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
"main": "test/testServer.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion source/js/DataController.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ DataController.prototype.resetRawData = function () {
if (!data[props][columnIndex] && !(byColumns ? pivotDefaultCol : pivotDefault))
return _.TOTAL_FUNCTIONS.totalSUM;
switch ((data[props][columnIndex] || {}).summary || pivotDefault) {
case "count": return _.TOTAL_FUNCTIONS.totalCOUNT;
case "count": return _.TOTAL_FUNCTIONS.totalSUM; // _.TOTAL_FUNCTIONS.totalCOUNT; https://github.com/intersystems-ru/LightPivotTable/issues/4
case "avg": return _.TOTAL_FUNCTIONS.totalAVG;
case "min": return _.TOTAL_FUNCTIONS.totalMIN;
case "max": return _.TOTAL_FUNCTIONS.totalMAX;
Expand Down

0 comments on commit b8f94d5

Please sign in to comment.