过滤Google脚本中的数据透视表以排除某些值

问题描述 投票:0回答:2

我已设法执行Google API以动态创建数据透视表,并使filtercriteria正常工作。下面是代码。

c = {
      11:{"visibleValues": ["value"]}
   };

然而,我现在面临的挑战是,我希望能够排除某些值,而不必列出所有可能的值。我试过hiddenValues,hiddenValue等。有什么想法可以帮助排除任何值吗?

pivot-table google-spreadsheet-api
2个回答
0
投票

由于没有为此指定ad-hoc方法,因此解决方法是:

  1. 获取所有值的列表
  2. 如果excluded_value不在full_list_of_values
  3. 返回excluded_value

0
投票

我担心设置过滤条件的唯一方法是使用“visibleValues”:https://developers.google.com/sheets/api/reference/rest/v4/PivotFilterCriteria

我有同样的问题,我最终收集了一个数组中的所有可见值,然后设置过滤器

"criteria": {
   11: {"visibleValues": myArrayOfVisibleValues } 
 }

希望这可以帮助!

© www.soinside.com 2019 - 2024. All rights reserved.