SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
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
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mohan123
Constraint Violating Yak Guru

India
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 ???????


P.V.P.MOhan

RickD
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:


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


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  
 New 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.11 seconds. Powered By: Snitz Forums 2000