Solved

sum of distinct member mdx

Posted on 2009-04-09
9
1,190 Views
Last Modified: 2012-05-06
Hi Team,

how to get the mdx for the distinct members like

Ex
market value
1 10
2 10
4 20
1 10

the output should be
1 10
2 10
4 20

Thanks in advance
Regards
0
Comment
Question by:krishna_harik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 250 total points
ID: 24105678
select Max(id),ValueofId from tablename group by valueofID
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24105685
use this.
create table dist
(
id int,
val int
)
 
insert into dist
select 1, 10 union all
select 2, 10 union all
select 4, 20 union all
select 1, 10
 
 
select Max(id),id,Val from dist group by id,val

Open in new window

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24105711
if you don't want to see three column in result set than use this one.

select id,val from
(
select Max(id) as maxid,id,Val from dist group by id,val
) t
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 25

Assisted Solution

by:lwadwell
lwadwell earned 100 total points
ID: 24105830
Hi krishna_harik,

try

SELECT DISTINCT market, value FROM yourtable

lwadwell
0
 

Author Comment

by:krishna_harik
ID: 24105831
I want the mdx to get the sum(distinct members)

not the sql query
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24105877
0
 
LVL 3

Assisted Solution

by:sateeshcv
sateeshcv earned 150 total points
ID: 24105926
HI,
try the below query
SELECT DISTINCT ID,VALUE FROM TABLE_NAME
0
 

Author Comment

by:krishna_harik
ID: 24105989
I want the mdx to get the sum(distinct members)

not the sql query!!! :(
0
 

Author Closing Comment

by:krishna_harik
ID: 31568450
thanks for your response
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question