MDX 初学者问题

发布于 2025-01-10 11:01:32 字数 1189 浏览 1 评论 0原文

我的第一个问题很抱歉我的无知。我是 MDX 新手,但很难获得我需要的结果。我在物流仓库工作,想计算一些内部交货时间。

为此,我需要具有以下布局的输出:

订单 ID |首先运行状态名称 |日期和时间 |运行状态 名称 最后 |日期和时间 |销售数量

数据字段称为

  • [OrderTable].[Order ID]
  • [OrderRunState].[Run State Name]
  • [Time Status History Created Date].[YQMD]
  • [Clock Status History Created Date].[Time Minute]
  • [Measure] .[销售数量]
  • [时间状态历史记录创建日期].[YQMD] <- 用于过滤

现在有 2 个“但是”。

  1. 首先运行状态名称。我需要基于日期和时间的第一个 RSN时间,但此 RSN 不能等于“A”或“B”或“C”。
  2. 运行状态名称最后需要等于“F”。

为了让它更清楚一点,我制作了一个小的 Excel 表格来说明我的意思。

Excel 表格示例

编辑:忘记添加我到目前为止所做的事情(请不要笑..很难;))。这不是我需要的,但我正在尝试逐步增加复杂性。

SELECT non empty
[Measures].[Sales QTY] on columns,

non empty
( [OrderTable].[Order ID].members,
[OrderRunState].[Run State Name].members,
[Time Status History Created Date.Y-Q-M-D].[Date].members,
[Clock Status History Created Date].[Time Minute].members )
on rows

FROM
[Operations]

WHERE
[Time Status History Created Date].[Yesterday].&[Yes]

仍需要添加日期和时间time 并具有“topcount”或“firstchild”之类的内容,但不包括 RSN A、B、C。

My first question here so sorry for my ignorance. I'm new to MDX but really struggling to get the results I need. I'm working in a logistics warehouse and would like to calculate some internal lead times.

For this I would need output with the following layout:

Order ID | Run State Name First | Date&Time | Run State Name Last | Date&Time | Sales QTY

The data fields are called

  • [OrderTable].[Order ID]
  • [OrderRunState].[Run State Name]
  • [Time Status History Created Date].[Y-Q-M-D]
  • [Clock Status History Created Date].[Time Minute]
  • [Measure].[Sales QTY]
  • [Time Status History Created Date].[Y-Q-M-D] <- used for filtering

Now there are 2 'buts'.

  1. Run State Name First. I would need the first RSN based on the date& time, but this RSN can't be equal to "A" or "B" or "C".
  2. Run State Name Last needs to be equal to "F".

To make it a bit clearer I've made a small Excel Table to illustrate what I mean.

Excel Table Example

EDIT: Forgot to add what I've done so far (please don't laugh..to hard ;)). It's not what I need but I'm trying to add complexity step by step.

SELECT non empty
[Measures].[Sales QTY] on columns,

non empty
( [OrderTable].[Order ID].members,
[OrderRunState].[Run State Name].members,
[Time Status History Created Date.Y-Q-M-D].[Date].members,
[Clock Status History Created Date].[Time Minute].members )
on rows

FROM
[Operations]

WHERE
[Time Status History Created Date].[Yesterday].&[Yes]

Still need to add date & time and have like "topcount" or "firstchild" but excluding RSN A,B,C.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文