您正在查看 Looker 26.2 的文档。点击此链接可查看
最新文档。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
approximate_threshold
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
用法
view: view_name {
measure: field_name {
approximate_threshold: 100000
}
}
|
层次结构
approximate_threshold
|
可能的字段类型
测量
接受
一个整数
|
定义
如果不同的值少于 1,000 个,Google BigQuery 旧版 SQL 会计算出精确的 count_distinct;但如果不同的值较多,则会进行近似计算。近似计数速度更快,但通常会有百分之几的误差。
如果您希望 BigQuery 旧版 SQL 计算超过 1,000 个不同值的精确 count_distinct,可以使用 approximate_threshold 参数设置该数量。
示例
返回最多 10 万个不同值的确切 count_distinct:
measure: unique_count {
type: count_distinct
approximate_threshold: 100000 # default value is 1000
sql: ${id} ;;
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-03-03。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-03-03。"],[],[]]