WebDataRocks End User License Agreement (“Agreement”) has been revised and is effective as of April 18, 2024.
The following modifications have been made:
The modified version of WebDataRocks End User License Agreement is available here.
Downloading, installing, and/or continuing to use WebDataRocks after April 18, 2024, constitutes your acceptance of the terms and conditions of the modified version of WebDataRocks End User License Agreement. If you do not agree to any of these terms and conditions, do not download, install, use, or access (or continue to access) WebDataRocks.
runQuery(query:Query Object)
Invoke this method on a pivot table instance. It takes a Query Object as an argument and runs it. The Query Object contains a slice
with rows
, columns
, measures
, and reportFilters
.
Use it if you need to:
Name | Type | Description |
---|---|---|
query | Query Object | Contains rows , columns , measures , and reportFilters from a Slice Object. |
Suppose you have a pivot table with the following report:
var pivot = new WebDataRocks({ container: "wdr-component", toolbar: true, report: { "dataSource": { "filename": "https://cdn.webdatarocks.com/data/data.csv" }, "slice": { "rows": [{ "uniqueName": "Category" }], "columns": [{ "uniqueName": "Measures" }, { "uniqueName": "Country" } ], "measures": [{ "uniqueName": "Price", "aggregation": "sum" }] } } });
If you want to rearrange the hierarchies in a slice dynamically with code, define the following slice and pass it as an argument to the runQuery()
method:
var slice = { "rows": [{ "uniqueName": "Country" }], "columns": [{ "uniqueName": "Category" }], "measures": [{ "uniqueName": "Price", "aggregation": "sum" }] }; webdatarocks.runQuery(slice);
Check out more details in the CodePen demo.