英文:
Distinct count in pivot adds 'empty' to pivot
问题
我很高兴发现数据透视表中有一个不同计数的选项。我使用它,但发现了一些我无法解释的情况:
当我使用普通的count
命令时,我得到一个漂亮的、整洁的表格,其中包含了所有的值(在这种情况下)。我检查了单元格,我已经填充了所有的空单元格:
但当我切换到unique count
时,突然之间表格中的值之间出现了一个'empty'。但只有1个:
我检查了数据,值之间没有空白。当我选择列,使用'前往' > '特殊' > '空单元格'时,我收到这个消息:
'未找到单元格'。
为什么在使用唯一计数选项时会发生这种情况?
我检查了数据范围的末尾(选择最后一个填充的行:ctrl + 向下箭头)在我的文件中:
这是包含在第1行的列标题的文件。
当我将其与Powerpivot进行比较(选择最后一行,ctrl + 向下箭头),我发现Powerpivot范围在第369692行结束,而这应该是369691行(列标题不再在第1行):
现在我唯一能想到的是,我看到Powerpivot显然是按照4行一组的方式工作,其中最后一组的最后一行是空的:
当我在Powerpivot中对特定列进行'空'筛选时,我得到了这个:
行号很奇怪,因为第1行通常是填充的:
但仍然,当数据范围中没有空行时,Powerpivot如何找到一个空行呢?
英文:
I was happy to find out there is an option for a distinct count in pivottables.
I used it, but found out something happened which I cannot explain:
When I use the normal count
command, I get a nice, decent table containing all the values in the (in this case) column. I checked the cells, I have filled all the empty cells with a value:
but when I switch to unique count
, suddenly the table has an 'empty' between the values. But only 1:
I checked the data, there is no empty between the values. When I select the column, use 'go to' > 'special' > 'empty cells' I get this message:
'No cells found'.
Why does this happen when using the unique count option?
I check the end of the data range (select the last filled row: ctrl + arrow down) in my file:
this is the file with the column headers in row 1.
When I compare this to Powerpivot (select the last row, ctrl + arrow down), I see the Powerpivot range ends in row 369692 while this should be 369691 (the column headers are not in row 1 anymore):
The only thing I can come up with now is that I see powerpivot works with blocks of 4 rows apparently, where the last row in the last block is empty:
When I filter the specific column in Powerpivot on 'Empty', I get this:
The row number is strange because row 1 is filled normally:
But still, how does Powerpivot find an empty row in the data range when there is no empty row?
答案1
得分: 0
可能的原因及解决方法
-
数据中存在隐藏字符或空格,导致出现
(空白)
值。使用TRIM
函数可以移除它们。 -
数据源或与数据源的连接出现问题。您可以尝试刷新数据源,看看是否解决了问题。
-
数据源中的
占位行
可能导致在透视表
中使用唯一计数函数
时出现(空白)
值。如果数据源中存在一个包含空单元格或带有隐藏字符或空格的占位行
,它可能会被唯一计数函数
计算为唯一值
。
英文:
Possible causes with solutions
-
hidden characters or spaces in the data that are causing the
(blank)
value to appear. using theTRIM
function will remove them -
Issue with the data source or the connection to the data source. You can try refreshing the data source and see if that resolves the issue.
-
placeholder row
in your data source could be causing the(blank)
value to appear when using theDistinct Count function
in apivot table.
If there is aplaceholder
row in your data source that contains empty cells or cells with hidden characters or spaces, it could be counted as aunique value
by theDistinct
Count function.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论