动态计算的列在不同的报告级别SSAS DAX查询
我正在尝试根据SSAS Cube中的派生度量来创建一个计算出的列,该措施将计算每个订单的案例数,因此,如果它具有3个案例,则它将具有3个案例。
现在我正在尝试要创建一个库属性,其中1 caseorder,2caseorder,3caseorder,3+caseorder。我尝试了以下一个
if([[nrofcase] = 1,“ nrofcase [1]”,if([nrofcase] = 2,“ nrofcase [2]”, 如果([[nrofcase] = 3,“ nrofcase [3]”,“ nrofcase [> 3]”)
)
但它无法正常工作,当报告的级别从QTR更改为一周时,重新计算不同的水平。
请让我知道是否有效。
I'm trying to create a calculated column based on a derived measure in SSAS cube, this measure which will count the number of cases per order so for one order if it has 3 cases it will have the value 3.
Now I'm trying to create a bucket attribute which says 1caseOrder,2caseOrder,3caseOrder,3+caseOrder. I tried the below one
IF([nrofcase] = 1, "nrofcase[1]", IF([nrofcase] = 2, "nrofcase[2]",
IF([nrofcase] = 3, "nrofcase[3]", "nrofcase[>3]") )
But it doesn't work as expected, when the level of the report is changed from qtr to week it was suppose to recalculate on different level.
Please let me know if it case work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
计算的列是静态的。当添加列以及处理表时,计算和存储值时。价值更改的唯一方法是重新处理模型。如果公式指的是DAX度量,则它将使用该措施而无需报告的任何上下文(例如,没有行过滤器或切片机等)。
这样想:
听起来您的数据,有多行告诉您每个订单的案例数,因此这是一个措施。使用度量代替计算的列。
Calculated columns are static. When the column is added and when the table is processed, the value is calculated and stored. The only way for the value to change is to reprocess the model. If the formula refers to a DAX measure, it will use the measure without any of the context from the report (eg. no row filters or slicers, etc.).
Think of it this way:
It sounds like for your data, there are multiple rows that tell you the number of cases per order, so this is a measure. Use a measure instead of a calculated column.