Showing posts with label dimension. Show all posts
Showing posts with label dimension. Show all posts

Friday, March 23, 2012

Mining cubes vs relational

I've not found much guidance so far about the pros and cons of mining OLAP cubes vs their underlying fact and dimension tables. Can anyone offer advice in this area, or point me to more info about this?

Thanks,
Kevin

Generally I recommend mining OLAP cubes when you are mining results that OLAP is good at producing, otherwise you should mine relational tables. OLAP is not particularly good at returning large amounts of detail data. However, if you were mining stores, for example, and your inputs were total sales of products for particular months/categories, or even sales acceleration of such by store, those measures are very difficult and slow to obtain through relational means, and I would recommend OLAP.

Another issue with OLAP MM's is that there really isn't any way to split data into training and validation sets. If this is a requirement, and you need to use the aggregation/calculation facilities of OLAP, you can get the OLAP results into a table, split into training and validation sets, and then mine the resultant relational table.

sql

Monday, March 19, 2012

Min and Max from one dimension based on Grouping from another dimension

Hi all,

I have 2 Dimensions D1 and D2. They both have a common Attribute "ID".

For one id in D1 there are multiple records in D2. This is like a parent child relationship with Product as parent Dimension and Product category as child dimension. For each product there are multiple product categories.

I want to get the Min and Max from child Dimension for each ID in Parent Dimension.

In sql this can be written as

select Distinct D1.ID,Min(D2.AttributeName) from D1,D2 where

D1.ID=D2.ID group by D2.ID

Can anybody write a MDX based on this?

Thanks

Girija.

Girija,

When there is Parent-Child Relationship between D1 and D2 as described Product and Product Category, I feel there should be Hierarchy in Cube for D1 and D2. And hoping you have set Order By Property to Key which stores ID and then simply you could use FirstChild for Min and LastChild for Max ID.

Bhudev

|||

Hi bhudev,

I gave parent - child reationship just as an example..... There is no hierarchy between those two dimensions.... They are connected only through ID.

Regards...

Girija Shankar

|||

Girija

I'm giving you the way how you can do it. Simply make Calculated Members for these ID under Measures Dimension and apply Min and Max function, I hope you will get yourself.

Bhudev

Min and Max for Dimension attribute

Hi all,

I want to get the minimum and maximum among the members of a dimension attribute. This attribute is a date. Can anybody give me a sample MDX query for this..

Regards...

Girija Shankar Beuria

Code Snippet

with member [Measures].[Min Date] as

MIN([Date].[Date].[Date].Members,[Date].[Date].CurrentMember.MemberValue)

member [Measures].[Max Date] as

MAX([Date].[Date].[Date].Members,[Date].[Date].CurrentMember.MemberValue)

select

{[Measures].[Min Date],[Measures].[Max Date]} on 0

from [Adventure Works]

;