如何通过仅保留至少一个值超过0的行来过滤枢轴表?
我不知道我的问题是否真的很清楚,所以我在这里发展:
我有一个枢轴表,我想滤出每个无值相等或以上1的行。
例如:示例:
标签 | 值1 | 值2 |
---|---|---|
a | 0 | 0 |
b | 0 | 1 |
c | 1 | 1 |
d | 1 | 0 |
e | 0 | 0 |
我希望能够对此进行过滤:
标签 | 值1 | 值2 |
---|---|---|
b | 0 | 1 |
c | 1 1 | 1 |
d | 1 | 0 |
是否可以使用Excel? 我到处搜索,找不到枢轴桌子可用的东西...
I don't know if my question is really clear, so I'll develop here:
I have a pivot table, and I would like to filter out every row which has no value equal or above 1.
Example:
label | value 1 | value 2 |
---|---|---|
a | 0 | 0 |
b | 0 | 1 |
c | 1 | 1 |
d | 1 | 0 |
e | 0 | 0 |
I would like to be able to filter it to this :
label | value 1 | value 2 |
---|---|---|
b | 0 | 1 |
c | 1 | 1 |
d | 1 | 0 |
is it possible with Excel?
I searched everywhere and I couldn't find anything usable with a pivot table...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何过滤枢轴行
执行此操作,我们可以从
pivotitems
从rowfields
中迭代pivotitems
,并检查相应的dataRange
以符合所示要求。对于那些不合适的人,设置可见= false
滤波行没有等于或大于1的值,我们可以使用此代码:
How to filter pivot rows
To do this, we can iterate over
PivotItems
fromRowFields
and check the correspondingDataRange
for compliance with the stated requirement. For those not suitable, setVisible = False
To filter rows with no values equal to or greater than 1 we can use this code: