| layout | post |
|---|---|
| title | Named Set |
| description | named set |
| platform | js |
| control | PivotTreeMap |
| documentation | ug |
| api | /api/js/ejpivottreemap |
Named sets is a multidimensional expression (MDX) that returns a set of dimension members which can be created by combining the cube data, arithmetic operators, numbers, and functions.
You can bind the named sets in the pivot tree map by setting it's unique name in the fieldName property either in the row or column axis and setting the isNamedSets Boolean property to true.
{% highlight js %}
<script type="text/javascript"> $(function() { $("#PivotTreeMap1").ejPivotTreeMap({ dataSource: { data: "http://bi.syncfusion.com/olap/msmdpump.dll", //data catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", columns: [{ fieldName: "[Customer].[Customer Geography]" }], rows: [{ fieldName: "[Core Product Group]", isNamedSets: true }], values: [{ measures: [{ fieldName: "[Measures].[Internet Sales Amount]", }], axis: "columns" }] } }); }); </script><! --Tooltip labels can be localized here-->
<script id="tooltipTemplate" type="application/jsrender">{% endhighlight %}
You can add the named sets in the pivot tree map by using the NamedSetElement class in the OlapReport.
{% highlight C# %}
OlapReport olapReport = new OlapReport(); olapReport.Name = "Customer Report"; olapReport.CurrentCubeName = "Adventure Works";
DimensionElement dimensionElementColumn = new DimensionElement(); dimensionElementColumn.Name = "Customer"; dimensionElementColumn.AddLevel("Customer Geography", "Country ");
MeasureElements measureElementColumn = new MeasureElements(); measureElementColumn.Elements.Add(new MeasureElement { Name = "Internet Sales Amount" });
NamedSetElement dimensionElementRow = new NamedSetElement(); dimensionElementRow.Name = "Core Product Group";
olapReport.CategoricalElements.Add(dimensionElementColumn); olapReport.CategoricalElements.Add(measureElementColumn); olapReport.SeriesElements.Add(dimensionElementRow);
{% endhighlight %}

