Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
About the use of "Getpivotdata"
I have a pivot table in Excel and the data source is from
an OLAP cube. I want to use macro for data manipulation. However, the process is dynamic. For example, if column field is "Month" and row field is "Region", then the statement for getting the sales of Region A in March will be GETPIVOTDATA("[Measures]. [Sales]",$A$4, "[Months]", "[Months].[March]", "[Region]","[Region].[Region A]") If column field is "Month" and row fields are "Region" and "Product", then the statement for for getting the Product A's sales of Region B in March will be GETPIVOTDATA("[Measures].[Sales]",$A$4, "[Months]", "[Months].[March]", "[Region]","[Region].[Region B]","[Region]","[Product].[Product A]") My main problem is that the number of fields in pivot table is not known. I donno how to write "getpivotdata" statement in a dynamic way. I hope somebody can help me to solve this problem. Thanks! Best Wishes, Polly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
"Best Practices" Use of GetPivotData Function | Excel Worksheet Functions | |||
GETPIVOTDATA question regarding adding "rows" | Excel Worksheet Functions |