I have the following output table:
Quote | art0001 | art0002 | art0003 |
=====================================
100 | 4 | 1 | 5 |
99 | 0 | 10 | 1 |
98 | 12 | 5 | 19 |
97 | 1 | 0 | 6 |
96 | 0 | 1 | 0 |
... | ... | ... | ... |
Well, I need the sum of the columns of art000x
to expand the output table with the total amount of the individual articles:
=====================================
| 17 | 17 | 31 |
Currently the alasql
-Code is defined as below:
var sqlRequest = [
'SELECT Quote, \ ' +
'art0001, \ ' +
'art0002, \ ' +
'art0003, \ ' +
'art0004, \ ' +
'art0005, \ ' +
'art0006, \ ' +
'art0007, \ ' +
'art0008, \ ' +
'art0009, \ ' +
'art0010, \ ' +
'art0011, \ ' +
'art0012, \ ' +
'art0013, \ ' +
'art0014 \ ' +
'INTO XLSXML("Test.xls", ?) FROM ?'
];
var opts = {
headers: true
}
$scope.btnExport = function () {
alasql(sqlString[0], [opts, $scope.listOfItems]);
}
An additional question: How can I reduce the sql SELECT string?
Thanks for your help!