Solved

sum of distinct member mdx

Posted on 2009-04-09
9
1,138 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
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now