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

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 fetch data frm DIM tbl as colns based on fact tbl

Author  Topic 

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2013-07-19 : 11:12:22
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

3608 Posts

Posted - 2013-07-23 : 08:56:01
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
   

- Advertisement -