Solved

sum of distinct member mdx

Posted on 2009-04-09
9
1,106 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

707 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

11 Experts available now in Live!

Get 1:1 Help Now