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'.
- 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".
- 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.
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.