这个错误信息表明在使用 cubes 库的时候,在维度上的钻取层级与剖切层级不一致,因此不能确定下一级的隐式层级。
要解决这个问题,应该检查在使用 cubes 库时的钻取层级和剖切层级是否一致。您可能需要修改代码中的钻取层级或剖切层级,或者添加更多信息来确定下一级的隐式层级。如果你不确定怎么做,可以请教库的文档或者社区讨论。
以下是一个示例,展示了如何使用 cubes 库进行钻取和剖切。在这个示例中,我们有一个 "sales" 的 cube,其中有 "date" 维度和 "product" 维度。
from cubes import Workspace # Create a workspace workspace = Workspace() # ReGISter the "sales" cube workspace.register_cube("sales") # Create a new browser browser = workspace.browser("sales") # Drill down on the "date" dimension browser.drilldown("date", ["year", "month"]) # Cut on the "product" dimension browser.cut("product", "product_name", "Product A") # PerfORM the query result = browser.aggregate()
如果在这个例子中,在维度 "date" 上钻取层级与剖切层级不一致,如:
browser.drilldown("date", ["year"]) browser.cut("date", "month", "January")
那么你会得到上述错误信息。因为钻取层级是"year",而剖切层级是"month"。如果你需要剖切某个月的数据,你需要先钻取到月份这一层级。
以上就是处理cubes出现报错HierarchyError("Cut hierarchy %s for dimension %s is ""different than drilldown hierarchy %s. ""Can not determine implicit next level."% (hier, dim, cut_的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号