?
Solved

sum of distinct member mdx

Posted on 2009-04-09
9
Medium Priority
?
1,215 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 750 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 25

Assisted Solution

by:lwadwell
lwadwell earned 300 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 450 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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