I am creating a pivot table with 1 row item, 1 column item, and 2 data items. The data items are oriented by row, but I would like them by column. (See the attached screen shot.) Could someone explain if this is possible?
Sample code:
table.AddFieldToArea(PivotFieldType.Row, “Date”)
table.AddFieldToArea(PivotFieldType.Column, “Name”)
table.AddFieldToArea(PivotFieldType.Data, “Primary”)
table.AddFieldToArea(PivotFieldType.Data, “Secondary”)
P.S. - I am able to do this in VBA with the following code:
With ActiveSheet.PivotTables(“Sheet2”).DataPivotField
.Orientation = xlColumnField
.Position = 2
End With