Articles in this section
Category / Section

How to find the default hierarchy name of a Dimension in JavaScript PivotGrid ?

1 min read

This KB illustrates that how to find the default hierarchy name of a Dimension.

Solution:

You can find the default hierarchy name of a dimension from the Olap report by using the following code example.

C#

public Dictionary<string, object> InitializeClient(string action, string customObject, string clientParams)
{
OlapDataManager DataManager = null;
DataManager = new OlapDataManager(connectionString);
DataManager.SetCurrentReport(CreateOlapReport());
string defaultHierarchyName = "";
var Dimensions = DataManager.CurrentCubeSchema.Dimensions;
for (int i = 0; i < Dimensions.Count; i++)
{
if(Dimensions[i].Name == "Enter valid dimension name")
defaultHierarchyName = Dimensions[i].DefaultHierarchyName;
}
return olapClientHelper.GetJsonData(action, DataManager, clientParams);
}

VB

Public Function InitializeClient(ByVal action As String, ByVal customObject As String, ByVal clientParams As String) As Dictionary(Of String, Object)
Dim DataManager As OlapDataManager = Nothing
DataManager = New OlapDataManager(connectionString)
DataManager.SetCurrentReport(CreateOlapReport())
Dim defaultHierarchyName As String = ""
Dim Dimensions = DataManager.CurrentCubeSchema.Dimensions
For i As Integer = 0 To Dimensions.Count - 1
If Dimensions(i).Name = "Enter valid dimension name" Then
defaultHierarchyName = Dimensions(i).DefaultHierarchyName
End If
Next i
Return olapClientHelper.GetJsonData(action, DataManager, clientParams)
End Function

 

Conclusion

I hope you enjoyed learning about how to  find the default hierarchy name of a Dimension in JavaScript PivotGrid.

You can refer to our  JavaScript PivotGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied