在 SSAS 多维数据集浏览器中减去 2 个度量作为总计

发布于 2024-12-17 08:16:44 字数 511 浏览 3 评论 0原文

我想这是一个普遍且基本的问题。我试图根据维度获取度量的“净值”。让我解释一下。

我有一个事实表 factTicket 和一个名为 Operation 的维度,它有 2 个值:Opened 和 Closed。目标是获取每个月打开和关闭的票证数量。 在多维数据集浏览器中,我根据操作维度对 TicketID 有一个不同计数测量,但我希望总计为打开减去关闭< /strong> 而不是 Opened + Closed

事实表有一条记录,其中包含每个打开的工单的日期,并且当工单关闭时会添加第二条记录(因此工单最多只能有 2 个记录)事实表中的记录)

是有可能吗?我找不到办法做到这一点..也许操作维度是一个坏主意,我应该每张票有 1 条记录,并带有 OpenedDate 和 ClosedDate 字段?我不相信它会解决问题,因为不同计数总是返回正值,因此总计仍将打开+关闭。

欢迎任何想法! 谢谢

I guess it's a common and basic issue. I'm trying to get the "net value" of a measure depending on a dimension. Let me explain..

I have a fact table factTicket and a dimension called Operation who have 2 values: Opened and Closed. The goal is to get the number of ticket opened and closed for each month.
In the Cube Browser, I have a Distinct Count Measure of the TicketID according to the Operation dimension, but I would like the Grand Total to be Opened minus Closed instead of Opened + Closed

The factTable has a record with the date for every opened ticket, and a second record is added when the ticket is closed (So a Ticket can only have a maximum of 2 records in the fact table)

Is it possible ? I can't find a way to do it.. Maybe the Operation Dimension is a bad idea and I should have 1 record per ticket, with an OpenedDate and ClosedDate field ? I don't believe it will fixe the probleme since Distinct Count always return positive value, so the Grand Total will still be Opened + Closed.

Any ideas is welcome !
Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许你一世情深 2024-12-24 08:16:44

范围函数正是我所需要的:

SCOPE([Dim Operation].[OpenClose].[All], [Measures].[TicketCount]);
THIS = [Dim Operation].[OpenClose].&[OPEN] - [Dim Operation].[OpenClose].&[CLOSE]
END SCOPE;

The scope function is what I needed:

SCOPE([Dim Operation].[OpenClose].[All], [Measures].[TicketCount]);
THIS = [Dim Operation].[OpenClose].&[OPEN] - [Dim Operation].[OpenClose].&[CLOSE]
END SCOPE;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文