Odd behavior with PivotTable showing zero instead of the value

cisco55

New Member
Joined
Mar 8, 2014
Messages
9
Greetings. For a couple years I have been an avid visitor, but I just this moment registered, as the issue is still completely unresolved. Thus, my first post.
(The only forum I trust about MS Excel on the Internet is this one. Mr Excel, you are wise and well-respected in my workbook. :)

My problem is this:

I use Excel 2010 and have Pivot Tables that are using a Data Connection which is being built (and rebuilt) with VBA.
The Pivot Table field is calculating a field that contains an integer value. The Pivot Table field filter properly displays this value.
However, the Pivot Table itself calculated Sum field only displays 0 (aka zero). Other fields that are exactly the same as this one are displaying properly. Mystifying.

I am assuming you will want to see a little code.
My data connection is built as follows:
Code:
ThisWorkbook.Connections.Add "ChartQuery", "", "OLEDB;Persist Security Info=0;DSN=Excel Files;DBQ=" & wbFullName & _        
";DefaultDir=" & wbPath & ";DriverId=1046;MaxBufferSize=1024;PageTimeout=5;BackgroundQuery:=False", sSQL, 2

(And yes, my sSQL is sound, there are no typos, no special character issues)

Keep in mind that the filter in the Pivot Table shows my value (for example, 14) however it always only displays a zero

My Pivot Table is formatting the field (like the others just like it) as a Number, two decimals
My Pivot Table data source is ChartQuery
The worksheet this is pulling from is also set to use Number format for the entire column, but changing that doesn't make any difference even on the other fields that are working.

Perhaps this is enough information to get us started. Please ask the questions that you may.
I've done everything but open my computer case looking for the bug or mistake here.

Thanks
Francisco Shillander
 
For anyone stuck on a similar issue, multiplying the data referenced by 1 fixes the issue of the pivot table treating the figures as string text. Simply add *1 at the end of the formula of the table your pivot table is linked to.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top