ステップ・バイ・ステップ(願わくば!)
1.Initially:
SELECT
NON EMPTY {[Measures].[Count of Assignee Reassignments]} ON COLUMNS,
NON EMPTY
{
(
[Related Assignee History].[Modified By Id].[Modified By Id].ALLMEMBERS
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
*[Related Assignee History].[Start Date Time].[Start Date Time].AllMembers
)
}
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM(
SELECT
(
Filter(
[Related Assignee History].[Modified By Id].Children
,Left([Related Assignee History].[Modified By Id].CurrentMember.Name,1)="n"
)
) ON COLUMNS
FROM(
SELECT
(
{ [Incident].[Owner Group].&[Directors Group]}) ON COLUMNS
FROM(
SELECT
(
{[Incident].[Reported Source].&[Self Service]}) ON COLUMNS
From(
Select
(
{[Related Assignee History].[Start Date Time].ITEM(0)}) on columns
FROM(
SELECT({[Date Reported].[Year].&[2016] }) ON COLUMNS
FROM [Incident]
)
)
)
)
);
結果は次のようになり
SELECT
NON EMPTY
[Measures].[Count of Assignee Reassignments] ON 0,
NON EMPTY
[Related Assignee History].[Modified By Id].[Modified By Id].ALLMEMBERS
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
*[Related Assignee History].[Start Date Time].[Start Date Time].ALLMEMBERS
FROM(
SELECT
FILTER(
[Related Assignee History].[Modified By Id].Children
,Left([Related Assignee History].[Modified By Id].CurrentMember.Name,1)="n"
) ON 0
FROM(
SELECT
[Incident].[Owner Group].&[Directors Group] ON 0
FROM(
SELECT
[Incident].[Reported Source].&[Self Service] ON 0
FROM(
SELECT
[Related Assignee History].[Start Date Time].ITEM(0) ON 0
FROM
(
SELECT [Date Reported].[Year].&[2016] ON 0
FROM [Incident]
)
)
)
)
);
2. [Date Reported].[Year].&[2016]
に興味がある場合は、狂ったネストされたサブセレクトから移動してください -
SELECT
NON EMPTY
[Measures].[Count of Assignee Reassignments] ON 0,
NON EMPTY
[Related Assignee History].[Modified By Id].[Modified By Id].ALLMEMBERS
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
*[Related Assignee History].[Start Date Time].[Start Date Time].ALLMEMBERS
FROM
(
SELECT
FILTER(
[Related Assignee History].[Modified By Id].Children
,Left([Related Assignee History].[Modified By Id].CurrentMember.Name,1)="n"
) ON 0
FROM
(
SELECT
[Related Assignee History].[Start Date Time].ITEM(0) ON 0
FROM [Incident]
)
)
WHERE
([Date Reported].[Year].&[2016]
,[Incident].[Owner Group].&[Directors Group]
,[Incident].[Reported Source].&[Self Service]);
3.NowはWITH
句の中にフィルターを動かすと、そのようなナサニエルなどNで始まる名前を検索しMember_Caption
プロパティを使用することができます: - WHERE
句にも同様にこのWHERE
句にインシデントのメンバーを移動することができますこの[Related Assignee History].[Start Date Time].ITEM(0)
は私が時間ビーイングのためにそれを削除しますので、それぞれの人のための分の日付を見つけるためにあなたの試みであることを推測
WITH
SET [N_names] AS
FILTER(
[Related Assignee History].[Modified By Id].[Modified By Id].MEMBERS
,Left([Related Assignee History].[Modified By Id].CurrentMember.MEMBER_CAPTION,1) = 'N'
)
SELECT
NON EMPTY
[Measures].[Count of Assignee Reassignments] ON 0,
NON EMPTY
[N_names]
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
*[Related Assignee History].[Start Date Time].[Start Date Time].ALLMEMBERS
FROM
(
SELECT
[Related Assignee History].[Start Date Time].ITEM(0) ON 0
FROM [Incident]
)
WHERE
([Date Reported].[Year].&[2016]
,[Incident].[Owner Group].&[Directors Group]
,[Incident].[Reported Source].&[Self Service]);
4.I'm:私たちは、その後SELECT
節で設定した名前のを使用します。
WITH
SET [N_names] AS
FILTER(
[Related Assignee History].[Modified By Id].[Modified By Id].MEMBERS
,Left([Related Assignee History].[Modified By Id].CurrentMember.MEMBER_CAPTION,1) = 'N'
)
SELECT
NON EMPTY
[Measures].[Count of Assignee Reassignments] ON 0,
NON EMPTY
[N_names]
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
*[Related Assignee History].[Start Date Time].[Start Date Time].ALLMEMBERS
FROM [Incident]
WHERE
([Date Reported].[Year].&[2016]
,[Incident].[Owner Group].&[Directors Group]
,[Incident].[Reported Source].&[Self Service]);
それは少し複雑になります5.Now:
WITH
SET [N_names] AS
FILTER(
[Related Assignee History].[Modified By Id].[Modified By Id].MEMBERS
,Left([Related Assignee History].[Modified By Id].CurrentMember.MEMBER_CAPTION,1) = 'N'
)
SET [N_names_plusDates] AS
GENERATE(
[N_names] AS N
, N.CURRENTMEMBER
* TAIL(
NONEMPTY(
[Related Assignee History].[Start Date Time].[Start Date Time].MEMBERS
,N.CURRENTMEMBER
)
)
)
SELECT
NON EMPTY
[Measures].[Count of Assignee Reassignments] ON 0,
NON EMPTY
[N_names_plusDates]
*[Related Assignee History].[Parent Incident Id].[Parent Incident Id].ALLMEMBERS
FROM [Incident]
WHERE
([Date Reported].[Year].&[2016]
,[Incident].[Owner Group].&[Directors Group]
,[Incident].[Reported Source].&[Self Service]);