Hi
I need create one measure for total sales amount Proportion by product category. For Example:
column measure
Productcate , Productname salesamount amount%
A, A1 100, 58%
A, A2 50 29%
A, A3 20 11%
A subtotal 170 73%
B, B1 50 83%
B, B2 10 17%
b subtotal 60 27%
Total 230 100%
How to design this code function?
Thanks.
James
I've never really paid attention to this but got curious when trying to debug something.
What's the difference between cdn.kendostatic.com and kendo.cdn.telerik.com?
In some Telerik documentation there are references to kendo.cdn.telerik.com. When I created a Telerik app in VS 2022, most references use cdn.kendostatic.com.
Should one be used over the other?
Hi,
How can I apply xmla data from asp.net core api to kendo pivotgrid using jquery.
So I created an endpoint that returns xmla data. just having a problem binding the data to the pivotgrid.
Hi there,
Legacy PivotGrid does not support special characters in the column field headers (and possibly elsewhere), e.g. '&'. Is there a recommended escaping strategy - for example if I have a 'you & me' string, how do I transform it? and should I do it before datasource-ing the Pivot or in a header template?
(Looks like PivotGrid V2 does support this out of the box)
Thanks,
Georgi
I am attempting to locally run in my environment the code from the following demo:
https://demos.telerik.com/kendo-ui/pivotgrid/local-flat-data-binding
If I use the code functionally as-is it works fine. If however I change to an older version I receive the following error:
Uncaught TypeError: e.aggregate is not a function
My application is using version 2014.2.1008 which does provide the Pivot Grid even as it is a very old version. Is this a known issue resolved in a later version? Or perhaps I am just doing something wrong. Below is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Pivot Grid Demo</title>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2014.2.1008/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2014.2.1008/styles/kendo.default.min.css" />
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2014.2.1008/styles/kendo.default.mobile.min.css" />
<script src="http://kendo.cdn.telerik.com/2014.2.1008/js/jquery.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2014.2.1008/js/kendo.all.min.js"></script>
<style>
#configurator {
width: 400px;
min-width: 400px;
display: inline-block;
vertical-align: top;
}
#pivotgrid {
width: 67%;
display: inline-block;
vertical-align: top;
}
</style>
</head>
<body>
<script src="https://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script>
<div id="example">
<div class="hidden-on-narrow" id="configurator"></div>
<div class="hidden-on-narrow" id="pivotgrid"></div>
<div class="responsive-message"></div>
<script>
$(document).ready(function () {
var pivotgrid = $("#pivotgrid").kendoPivotGrid({
filterable: true,
sortable: true,
columnWidth: 120,
height: 570,
dataSource: {
data: products,
schema: {
model: {
fields: {
ProductName: { type: "string" },
UnitPrice: { type: "number" },
UnitsInStock: { type: "number" },
Discontinued: { type: "boolean" },
CategoryName: { field: "Category.CategoryName" }
}
},
cube: {
dimensions: {
ProductName: { caption: "All Products" },
CategoryName: { caption: "All Categories" },
Discontinued: { caption: "Discontinued" }
},
measures: {
"Sum": { field: "UnitPrice", format: "{0:c}", aggregate: "sum" },
"Average": { field: "UnitPrice", format: "{0:c}", aggregate: "average" }
}
}
},
columns: [{ name: "CategoryName", expand: true }, { name: "ProductName" } ],
rows: [{ name: "Discontinued", expand: true }],
measures: ["Sum"]
}
}).data("kendoPivotGrid");
$("#configurator").kendoPivotConfigurator({
dataSource: pivotgrid.dataSource,
filterable: true,
sortable:true,
height: 570
});
});
</script>
</div>
</body>
</html>
I am currently working with the Pivot Grid; its quite nice. I have noticed though that if the Column is removed, the grid itself still retains data and formatting unique to that column. Using the demo as an example:
https://demos.telerik.com/jsp-ui/pivotgrid/index
The default columns are:
[Date].[Calendar] and [Product].[Category]
The default measure is:
[Measures].[Reseller Freight Cost]
If you remove all three of the above, both column fields and the measure, the resulting PivotGrid will still reflect a financial amount even though only a Row is populated with a Field.
See screen shot:
This is confusing to me and my users; why is it working this way? Is it possible to change this behavior?
Hi,
I am using the latest version of Kendo UI i.e. 2017.3.921. I am trying to include in my solution the kendo-pivot but it seems that some of the features are not working:
1. The configuration option sortable enables the "Sort Ascending / Descending" options in the pivot grid BUT when clicked they do nothing. I tried in local binding demo and added the sortable: true just below the filterable property, and it does not work. I tied the same in the documentation of the sortable configuration setting but the dojo example does nothing
2. I have a kendo-pivot bound to a datasource with remote data of json type. I perform a read operation, the kendo pivot as well as the kendo configurator is populated with data. The pivot has only one Row dimension and no column fields (one measure, only). Should I expand the Row dimension to all its values and force a requery i.e. datasource.read() again the read function of the transport definition is execute OK BUT the statement options.sucess fails with the exception "cannot read property value of undefined"
function
preparePivotDS(espqParams, esOptions) {
var
qParams = angular.isFunction(espqParams) ? espqParams() : espqParams;
var
xParam = {
transport: {
requestEnd:
function
(e) {
var
response = e.response;
var
type = e.type;
console.log(type);
// displays "read"
console.log(response.length);
// displays "77"
},
read:
function
(options) {
var
pqOptions = {};
var
executeParams = qParams.Params;
if
(executeParams
instanceof
esGlobals.ESParamValues) {
if
(!executeParams.isValidState()) {
var
err =
new
Error($translate.instant(
"ESUI.PQ.PARAMS_MISSING"
));
options.error(err);
throw
err;
}
executeParams = executeParams.getExecuteVals();
}
esWebApiService.fetchPublicQuery(qParams.GroupID, qParams.FilterID, pqOptions, executeParams)
.then(
function
(pq) {
pq = pq.data;
options.success(pq.Rows || []);
})
.
catch
(
function
(err) {
$log.error(
"Error in DataSource "
, err);
options.error(err);
});
},
}
};
if
(esOptions) {
angular.extend(xParam, esOptions);
}
return
new
kendo.data.PivotDataSource(xParam);
}