Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Want to get Dimension's field name in macro

     Hi,

I have Pivot chart with 2 dimesion and in macro i want to get all fields name in 2nd dimension.

Any help would be appreciated.

Thanks

Vijay

8 Replies
isaiah82
Creator III
Creator III

Here's a sample which will display the label (not necessarily the field name..) for the 2nd dimension column in chart ObjectID:

Sub GetDimName

set chart = ActiveDocument.GetSheetObject("ObjectID")

set cp = chart.GetProperties

set dimensions = cp.Dimensions

msgbox(dimensions(1).Title.v)

End Sub

Not applicable
Author

Thanks for your reply.

But i need second dimension's column values which are 8-9.

isaiah82
Creator III
Creator III

What is it exactly that you're trying to accomplish?  Is this a calculated dimension?  If not check out GetPossibleValues in the API Guide.  Not sure if that will help depending on what you're after.

Not applicable
Author

untitled.bmp

Not applicable
Author

untitled.bmp

Not applicable
Author

if you can see i have extra null Category at last right side , i want to hide this in macro. I dont want to use Suppress Null values as user wants to see all Tenor and Category combinations. please let me know is there any way to achieve this.

Not applicable
Author

if you can see i have extra null Category at last right side , i want to hide this in macro. I dont want to use Suppress Null values as user wants to see all Tenor and Category combinations. please let me know is there any way to achieve this.

isaiah82
Creator III
Creator III

I don't see any way you could use a macro to solve for this if you don't want to suppress null.  I'm guessing you also tried supress null together with Show All Values?  I remember there being a known issue with that a while back (null would still show.)

Alternatively could you just create an expression for each "Category" using Set Analysis to set the category for each column?  So you would have a different Expression for each Category.  I do this with months of the year sometimes.   I can think of other ways to solve for this too (e.g. synthetic dimension using possible values in Category field) but it gets a bit ugly.  Open to if others have any better solutions.