CubeFields.GetMeasure(Object, XlConsolidationFunction, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Given an attribute hierarchy, returns an implicit measure for the given function that corresponds to this attribute. If an “implicit measure” does not exist, a new implicit measure is created and added to the CubeFields collection.
public Microsoft.Office.Interop.Excel.CubeField GetMeasure (object AttributeHierarchy, Microsoft.Office.Interop.Excel.XlConsolidationFunction Function, object Caption);
Public Function GetMeasure (AttributeHierarchy As Object, Function As XlConsolidationFunction, Optional Caption As Object) As CubeField
Parameters
- AttributeHierarchy
- Object
The unique cube field that is an attribute hierarchy (XlCubeFieldType = xlHierarchy and XlCubeFieldSubType = xlCubeAttribute).
- Function
- XlConsolidationFunction
The function performed in the added data field.
- Caption
- Object
The label used in the PivotTable report to identify this measure. If the measure already exists, caption will overwrite the existing label of this measure.
Returns
Remarks
Important: Getting a measure by using the GetMeasure function will work for these functions only: Count, Sum, Average, Max and Min. For example:These will workGet CubeField0 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlCount, "NumCarsOwnedCount")Set CubeField1 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlSum, "NumCarsOwnedSum")Set CubeField2 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlAverage, "NumCarsOwnedAverage")Set CubeField4 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlMax, "NumCarsOwnedMax")Set CubeField5 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlMin, "NumCarsOwnedMin")These will not workSet CubeField3 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlCountNums, "NumCarsOwnedCountNums")Set CubeField6 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlProduct, "NumCarsOwnedProduct")Set CubeField7 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlStDev, "NumCarsOwnedStDev")Set CubeField8 = modelPivotTable.CubeFields.GetMeasure("[customer].[num_cars_owned]", xlStDevP, "NumCarsOwnedStDevP")
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기