您目前查看的是 Looker 26.6 的說明文件。按一下這個連結,即可查看
最新說明文件。
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 參數設定該值。
範例
傳回最多 100,000 個相異值的確切 count_distinct:
measure: unique_count {
type: count_distinct
approximate_threshold: 100000 # default value is 1000
sql: ${id} ;;
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-04-30 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-04-30 (世界標準時間)。"],[],[]]