Solved

sum of distinct member mdx

Posted on 2009-04-09
9
1,128 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
 
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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

937 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

10 Experts available now in Live!

Get 1:1 Help Now