pivot table does not summarize properly

159
4
3 weeks ago
Labels (2)
Anne-MarieDubois
New Contributor III

Me again,

I'm running into a weird issue. I'm trying to use the pivot table tool to summarize data from a feature class. The idea is to have main class as rows and subclasses as column and get area total at intersection. 

AnneMarieDubois_0-1714497149677.png

Then, I use a cursor to sum all subclasses value into a new total main class column.

While trying to validate the cursor coding results, I noticed that I didn't get the same total values

AnneMarieDubois_1-1714497434884.png

I have exported my raw data to excel and tried to figure out what the problem is and from what I get, the pivot tool does not calculate correctly the area sums (or at least not for all classes??).

AnneMarieDubois_2-1714497728817.png

 

Does anyone have an idea about what causes this? There is no selection or subfiltrer on the input data to pivot table.

 

Thanks!

 

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Pivot Table (Data Management)—ArcGIS Pro | Documentation

There are some warnings in the tool useage about uniqueness (Frequency) and nulls, which you have, but the tool didn't fail though


... sort of retired...
0 Kudos
Anne-MarieDubois
New Contributor III

You mean that because certain class/subclass combination don't have a value it would explain the wrong totals?

Because I got no error while running the tool and it completed everytime.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Frequency (Analysis)—ArcGIS Pro | Documentation

The implication is that if a combination doesn't exist, you can't compare the individual totals via different methods


... sort of retired...
0 Kudos
MarkGilbert
Esri Contributor

I'm not certain that Pivot Table is the tool you should be using. I recently used it in a project and don't recall there being any summary operation. Pivot Table can be used to turn rows in a table into columns. Say, for example, you wanted to turn (or pivot) each of your main classes into columns.

Can you try and explain, in another way, what type of summary you are trying to accomplish? Maybe there is a more appropriate tool like Summary Statistics or Calculate Field.

0 Kudos