Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 fetch data frm DIM tbl as colns based on fact tbl
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

252 Posts

Posted - 07/19/2013 :  11:12:22  Show Profile  Reply with Quote
My question:How to fectch data from DIM table attributes as a columns based on fact table key.

We are using dot net application for customized reports with MDX scripting. I am new for writing the MDX Quries. Can anyone help for fetching the data from the below question.

1) For each CPKey we have List of patients
2) For each Patient information available in Patient dim table.
How can I retrieve patient information as a column from Patient DIM table, when I have the CPKey from the dot net application by the MDX?
Expected result set like below

PatientID	PatientName	MemberNum	Phone	Age	Gender	Conditions
1	abc	12345	111111	25	F	NULL

Sql >>>>>
Select p.* from
ConditionprevalencePatient cpp
Inner join patient p
On p.Patientid = cpp.Patient

MDX ???????


Slow But Sure Yak Herding Master

United Kingdom
3608 Posts

Posted - 07/23/2013 :  08:56:01  Show Profile  Reply with Quote
By which measure are you trying to find patients?

I think you may need to remember that MDX is not SQL although it can look similar and that cubes do not store or display data in the same method as a RDBMS (Such as SQL). the data you look for in a cube is a slice by 3 dimensions, rather than a 2 dimensional flat model like an RDBMS.

The measure is your way of getting dimensions with certain data.

In principle, your MDX will be along the lines of:

[Measure].[your measure] ON Rows
, [Patient].[PatientID].[1], [Patient],[PatientName].MEMBER ..etc ON Columns

But I would definitely suggest picking up an MDX reference book if you are new to it.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000