I tried the following lines(excerpt) to build pivot table on a single numerical column to identify number of times each value repeats. This throws 2 columns of same value and grand total. I'm unable to get the desired result. Pls suggest.
wb.ActiveSheet.PivotTables(PivotTableName).PivotFields('Amount').Orientation = win32c.xlRowField wb.ActiveSheet.PivotTables(PivotTableName).PivotFields('Amount').Position = 1 wb.ActiveSheet.PivotTables(PivotTableName).PivotFields('Amount').Orientation = win32c.xlDataField
Note: Also tried wb.ActiveSheet.PivotTables(PivotTableName).PivotFields('Amount').Function=win32c.xlCount, and not working either.
Data
Expected Pivot Result in Excel after writing python code

