Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Help in combining 4 different MDX queries


Help in combining 4 different MDX queries

Author
Message
8reat1s
8reat1s
SSC Rookie
SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)

Group: General Forum Members
Points: 46 Visits: 131
Hi guys,

I am new to complex MDX queries
I have managed to write these queries but now i need to combine them all together so that I get 4 columns of result set instead of one columns in every result set.

Can you please help me with this request

Can you please use the comment heading for the column names

//=======================================================================================
// Latest Bill
//=======================================================================================

WITH SET [Row Axis] AS
NONEMPTY(
{[Dim Customer].[Party Name].[Party Name].MEMBERS} *
{[Insert Datetime].[Date].[Date].MEMBERS}
,([Measures].[New Charge Amount])
)
MEMBER [Measures].[RowNumber] AS
RANK (
(
[Dim Customer].[Party Name].CurrentMember,
[Insert Datetime].[Date].CurrentMember
),
[Row Axis]
)
SELECT
{
[Measures].[New Charge Amount]
} ON COLUMNS,
TOPCOUNT
(
[Row Axis],
1,
([Measures].[RowNumber])
) ON ROWS
FROM [ACCOUNT_LEVEL]

//=======================================================================================
// Oldest Bill
//=======================================================================================

WITH SET [Row Axis] AS
NONEMPTY(
{[Dim Customer].[Party Name].[Party Name].MEMBERS} *
{[Insert Datetime].[Date].[Date].MEMBERS}
,([Measures].[New Charge Amount])
)
MEMBER [Measures].[RowNumber] AS
RANK (
(
[Dim Customer].[Party Name].CurrentMember,
[Insert Datetime].[Date].CurrentMember
),
[Row Axis]
)
SELECT
{
[Measures].[New Charge Amount]
} ON COLUMNS,
BottomCOUNT
(
[Row Axis],
1,
([Measures].[RowNumber])
) ON ROWS
FROM [ACCOUNT_LEVEL]

//=======================================================================================
// Biggest Invoices
//=======================================================================================


SELECT
{[Measures].[New Charge Amount]} ON COLUMNS,

TOPCOUNT(
{[Dim Customer].[Party Name].CHILDREN}*
{([Insert Datetime].[Date].CHILDREN)},
1,
([Measures].[New Charge Amount])
) ON ROWS
FROM [ACCOUNT_LEVEL]

//=======================================================================================
// Lowest Invoices
//=======================================================================================


WITH
MEMBER [Measures].[Invoice Rank] AS
RANK(
[Insert Datetime].[Date].CurrentMember,
[Insert Datetime].[Date].CurrentMember.Siblings,
([Measures].[New Charge Amount])
)
SELECT
{
([Measures].[New Charge Amount])
} ON COLUMNS,
TOPCOUNT
(
FILTER
(
{[Dim Customer].[Party Name].CHILDREN}*
{[Insert Datetime].[Date].CHILDREN},
([Measures].[New Charge Amount])>0
),
1,
([Measures].[Invoice Rank])
)
ON ROWS
FROM [ACCOUNT_LEVEL]

Thank you in advance
8reat1s
8reat1s
SSC Rookie
SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)

Group: General Forum Members
Points: 46 Visits: 131
Hi Guys,

any thoughts about this post!

can help would be appreciated

Thank you
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search