Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1085
Get members of dimension
posted

Hello!

Is there a way to get all members of a single dimension?

I have an application were we want to restore saved pivotviews and I have the issue that I cannot check if a given member exists because I don't find any way to get the members of any dimension.

Additionally it would be great to have a chance to get the names of certain members. For example if we filter a dimension for a single value, I can only obtain the ID of the filtered object, but not its name.

BR

Daniel

Parents
No Data
Reply
  • 23953
    Offline posted

    Hello Daniel,

    Depending on the data source that you're using (ig.OlapFlatDataSource or ig.OlapXmlaDataSource) for your igPivotGrid you would use its API. For example if you're using ig.OlapFlatDataSource you can get the member of the column axis using ig.OlapFlatDataSource.columnAxis method and for row axis ig.OlapFlatDataSource.rowAxis method.

    Here is an example:

    var colAxis = $("#pivotGrid").igPivotGrid("option", "dataSource").columnAxis();

    Each member has an unique name which you can obtain with the ig.Measure.uniqueName() method.

    Example:

    $("#pivotGrid").igPivotGrid("option", "dataSource").columnAxis()[0].uniqueName();

    To get the filtered members use the ig.OlapFlatDataSource.getFilterMemberNames() method like this:

    $("#pivotGrid").igPivotGrid("option", "dataSource").getFilterMemberNames("[Product].[Product]");

    I'm also attaching a sample which demonstrates how you can programmatically set dimensions when initializing the igPivotGrid.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc.

    igPivotGrid_Filtering.zip
Children