dbTalk Databases Forums  

MDX: Sum of selected members

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX: Sum of selected members in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Barrett Jensen
 
Posts: n/a

Default MDX: Sum of selected members - 07-13-2004 , 01:44 PM






Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member in a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client application
(TARGIT) and show this calculated member for EACH of the selected members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes two or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need to
elaborate! :-)

--
Michael Barrett




Reply With Quote
  #2  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Sum of selected members - 07-13-2004 , 02:18 PM






Hey Michael

This sounds a bit mysterious...on one hand you say you want to make a
permanent calculated member and on the other you say that sometimes the user
chooses one member, sometimes two and so forth...

As I interpret this you actually need to group some dimension members
together into one group ?

This isn't usually done by MDX - this is done by adding a grouping column to
the underlying relational dimension table and then using this grouping
column as a level in the dimension and when looking at the data in Targit.

--Michael Vardinghus


"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i en
meddelelse news:OZQnXlQaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member in a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client application
(TARGIT) and show this calculated member for EACH of the selected members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes two or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need to
elaborate! :-)

--
Michael Barrett






Reply With Quote
  #3  
Old   
Michael Barrett Jensen
 
Posts: n/a

Default Re: Sum of selected members - 07-13-2004 , 02:50 PM



Hi Michael

Thanks for your reply...

Well - maybe I wasn't quite clear enough in my first post. :-) Basically I
need the sum of a measure for the members that the user has selected in the
client application - like this:

Member A: 10 (selected)
Member B: 20
Member C: 15 (selected)

Sum of selected members: 25.

So the number 25 is what I need to get from my calculated member. :-)

--
Michael

"Michael Vardinghus" <michaelvardinghus (AT) notexisting (DOT) com> wrote

Quote:
Hey Michael

This sounds a bit mysterious...on one hand you say you want to make a
permanent calculated member and on the other you say that sometimes the
user
chooses one member, sometimes two and so forth...

As I interpret this you actually need to group some dimension members
together into one group ?

This isn't usually done by MDX - this is done by adding a grouping column
to
the underlying relational dimension table and then using this grouping
column as a level in the dimension and when looking at the data in Targit.

--Michael Vardinghus


"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i en
meddelelse news:OZQnXlQaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member in a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client application
(TARGIT) and show this calculated member for EACH of the selected
members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes two
or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need to
elaborate! :-)

--
Michael Barrett








Reply With Quote
  #4  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Sum of selected members - 07-13-2004 , 05:51 PM



Check out the AXIS() function. You'll need to wrap it in STRTOSET since the
server won't allow you to define a calculated member using the AXIS()
fucntion since it can't bind to the members.


--
Sean Boon
Microsoft Office BI

This posting is provided "AS IS" with no warranties, and confers no rights.

"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> wrote in
message news:uKFHqKRaEHA.3420 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
Hi Michael

Thanks for your reply...

Well - maybe I wasn't quite clear enough in my first post. :-) Basically I
need the sum of a measure for the members that the user has selected in
the client application - like this:

Member A: 10 (selected)
Member B: 20
Member C: 15 (selected)

Sum of selected members: 25.

So the number 25 is what I need to get from my calculated member. :-)

--
Michael

"Michael Vardinghus" <michaelvardinghus (AT) notexisting (DOT) com> wrote in message
news:%23QBr91QaEHA.1248 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Michael

This sounds a bit mysterious...on one hand you say you want to make a
permanent calculated member and on the other you say that sometimes the
user
chooses one member, sometimes two and so forth...

As I interpret this you actually need to group some dimension members
together into one group ?

This isn't usually done by MDX - this is done by adding a grouping column
to
the underlying relational dimension table and then using this grouping
column as a level in the dimension and when looking at the data in
Targit.

--Michael Vardinghus


"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i
en
meddelelse news:OZQnXlQaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member in a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client application
(TARGIT) and show this calculated member for EACH of the selected
members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes two
or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need to
elaborate! :-)

--
Michael Barrett










Reply With Quote
  #5  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Sum of selected members - 07-14-2004 , 09:03 AM



I actually still don't see the need for a calculated member.

In some front ends (like targit) you can select A, B, and C (multiple
selection) specified below in a criteria field and then the cross tab will
show the sum of these
3. However...when using multiple selections you cannot do drill through to
detail transactions using Targit / Analysis Services - so if you plan to do
this you need another way.

If it's some kind of permanent grouping you're looking for I very much
prefer the method I suggested with putting a column into the dimension table
and using this column to create a dimension (perhaps virtual) in Analysis.
Like this you can do drill through.

With you're calculated member you will not be able to do drill through
either...

--Michael Vardinghus

"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i en
meddelelse news:uKFHqKRaEHA.3420 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
Hi Michael

Thanks for your reply...

Well - maybe I wasn't quite clear enough in my first post. :-) Basically I
need the sum of a measure for the members that the user has selected in
the
client application - like this:

Member A: 10 (selected)
Member B: 20
Member C: 15 (selected)

Sum of selected members: 25.

So the number 25 is what I need to get from my calculated member. :-)

--
Michael

"Michael Vardinghus" <michaelvardinghus (AT) notexisting (DOT) com> wrote in message
news:%23QBr91QaEHA.1248 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Michael

This sounds a bit mysterious...on one hand you say you want to make a
permanent calculated member and on the other you say that sometimes the
user
chooses one member, sometimes two and so forth...

As I interpret this you actually need to group some dimension members
together into one group ?

This isn't usually done by MDX - this is done by adding a grouping
column
to
the underlying relational dimension table and then using this grouping
column as a level in the dimension and when looking at the data in
Targit.

--Michael Vardinghus


"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i
en
meddelelse news:OZQnXlQaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member in
a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client
application
(TARGIT) and show this calculated member for EACH of the selected
members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes two
or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need to
elaborate! :-)

--
Michael Barrett










Reply With Quote
  #6  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: Sum of selected members - 07-14-2004 , 09:19 AM



One other thing:

It may seem as if a calculated member is the easy way to about it - but what
about the maintenance in the future ? You will need to get access to the
server if you want to change the dimension members in the formula.

If you put it in a sql table it's easier to get the changes in the future to
the end user - either by a web page or by excel import.

--Michael Vardinghus


"Michael Vardinghus" <michaelvardinghus (AT) notexisting (DOT) com> skrev i en
meddelelse news:eAzslqaaEHA.2576 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
I actually still don't see the need for a calculated member.

In some front ends (like targit) you can select A, B, and C (multiple
selection) specified below in a criteria field and then the cross tab will
show the sum of these
3. However...when using multiple selections you cannot do drill through to
detail transactions using Targit / Analysis Services - so if you plan to
do
this you need another way.

If it's some kind of permanent grouping you're looking for I very much
prefer the method I suggested with putting a column into the dimension
table
and using this column to create a dimension (perhaps virtual) in Analysis.
Like this you can do drill through.

With you're calculated member you will not be able to do drill through
either...

--Michael Vardinghus

"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev i en
meddelelse news:uKFHqKRaEHA.3420 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi Michael

Thanks for your reply...

Well - maybe I wasn't quite clear enough in my first post. :-) Basically
I
need the sum of a measure for the members that the user has selected in
the
client application - like this:

Member A: 10 (selected)
Member B: 20
Member C: 15 (selected)

Sum of selected members: 25.

So the number 25 is what I need to get from my calculated member. :-)

--
Michael

"Michael Vardinghus" <michaelvardinghus (AT) notexisting (DOT) com> wrote in
message
news:%23QBr91QaEHA.1248 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Michael

This sounds a bit mysterious...on one hand you say you want to make a
permanent calculated member and on the other you say that sometimes
the
user
chooses one member, sometimes two and so forth...

As I interpret this you actually need to group some dimension members
together into one group ?

This isn't usually done by MDX - this is done by adding a grouping
column
to
the underlying relational dimension table and then using this grouping
column as a level in the dimension and when looking at the data in
Targit.

--Michael Vardinghus


"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> skrev
i
en
meddelelse news:OZQnXlQaEHA.4032 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hey Group! :-)

Here's my problem. I need to create a (permanent) calculated member
in
a
cube with Measures as the parent dimension.

The calculated member has to take the sum of a measure for a range of
members that the user has selected as criteria in the client
application
(TARGIT) and show this calculated member for EACH of the selected
members.

In pseudo-MDX:

sum({selectedMembers}, [Measures].[MyMeasure])

However - my problem is how to determine the selected members in the
calculated member. Sometimes the user chooses one member, sometimes
two
or
more - and in other cases none at all!

Any help will be greatly appreciated. Please let me know, if I need
to
elaborate! :-)

--
Michael Barrett












Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.