Showing posts with label iam. Show all posts
Showing posts with label iam. Show all posts

Sunday, February 19, 2012

Design Question (Analysis Services or Integration Services)

Hi,

I have a design issue and not sure, which approach to follow. Iam not sure, if I have to use analysis services or integration services. But we would like to use price trending also, so probably analysis services could be an option.

We have a table which stores the Customer Items information. For making it easier, I will talk about customer 1 and item 1as shown in the table below:

CustomerID

CustomerCategoryID

RegionId

ItemID

Price

1

1

2

1

10.00

2

1

2

1

12.00

3

1

2

1

14.00

4

2

1

1

18.00

5

2

1

1

16.00

6

3

3

1

15.00

7

4

3

1

12.00

Now the Customers can belong to a single Category and single Region

Customer Categories are 6 (1 -6) and Category 7 indicates all Categories.

Regions are 6 (1-6) and Region 7 indicates all Regions.

Now the reports run from the following particular cube (under the assumption that analysis services will be used to build the following cube)

CustomerID

CustomerCategoryID

RegionID

ItemID

Price

LowPrice

AveragePrice

1

1

2

1

10.00

10.00

12.00

2

1

2

1

12.00

10.00

12.00

3

1

2

1

14.00

10.00

12.00

1

2

1

1

10.00

16.00

17.00

1

3

3

1

10.00

15.00

15.00

1

4

3

1

10.00

12.00

12.00

1

7

1

1

10.00

16.00

17.00

1

7

2

1

10.00

10.00

12.00

1

7

3

1

10.00

12.00

13.50

1

7

4

1

10.00

NULL

NULL

1

7

5

1

10.00

NULL

NULL

1

7

6

1

10.00

NULL

NULL

1

1

7

1

10.00

10.00

12.00

1

2

7

1

10.00

16.00

17.00

1

3

7

1

10.00

15.00

15.00

1

4

7

1

10.00

12.00

12.00

1

5

7

1

10.00

NULL

NULL

1

6

7

1

10.00

NULL

NULL

As you can see in the above table for customer 1 and item 1, the lowest and average price is calculated for every available combination for categoryid and regionid(the ones in red indicate all regions and all categories). This may not be the best example, but hope it will help in understanding the issue here. What is the best approach to design this one ? If I have to design the cube can anybody help me in getting started. I have a basic understanding of MDX queries and trying to get a hang of it.

Thanks in advance for your help.

-Prash

Hi,

This is the general dimension model and analysis server 2005 can take care of this very easily.

If you have seperate tables for the Customers, CustomerCategory, Region and Items, then start of by modelling these as dimensions in analysis server. The fact table which you have shown would have foreign key references to the dimenison tables.

If you dont have dimension tables, you can create them. Customers and CustomersCategory can be attributes of the same dimension.

You will have Price, LowPrice and AveragePrice as your measures in the cube.

start of by creating a DataDource, then a DataSourceView. Once this is ready, click on new cube, then select your fact and dimension tables, select your measures and click finish.

The DSV (DataSourceView) would identify the fact and dimension tables. you would need to create primary keys and then create relationships from the fact table to the dimension tables. (for customers, region and item tables)

Hope this is what you were looking for

Regards

|||

Thanks for the reply. I did go ahead and build the cube with Price, LowPrice and AveragePrice as measure.

But Iam having problem with the query below for building the above mentioned report. Any help on this would be really appreciated.

Select

{

[Measures].[Price]

,[Measures].[MinimumPrice]

,[Measures].[AveragePrice]

} on Columns,

{

(

Filter

(

NONEMPTYCrossJoin

([DimRegions].[DimRegions].Children,

[DimCustomerCategories].[DimCustomerCategories].Children,

[DimItem].[ItemName].Children,

[DimCustomer].[CustomerName].Children

)

,[Measures].[Count No Of Rows] > 1

)

)

} on Rows

From [Cube1]

Design Question

Hi,

Iam having problem designing a proper solution for the current architecture, we have for a web application.

I would like to make use of Analysis Services, but not sure how to....

These are the typical course of events, which happen :

1) Data is uploaded into a maintenance database

Here during the data upload, a lot of calculations take place and some tables which contain the result of calculations are altered/populated. Usually, this takes hours to take place because of the number of rows being updated, deleted and added.(Usually in millions)

Scenario:

    previous data is deleted (not all, only the required)

    the tables corresponding to the uploaded data are modified(around 20 tables)

    calculations are perfomed on the uploaded data

    the tables corresponding to the calculations are updated.

2) The maintenance database is replicated to the production database.

This process is a pain in the neck and hence would like to use to analysis services.But Iam not sure of how to do it. In which direction should I proceed?Do I need a datawarehouse to perform the complex calculations ? Do I need to maintain separate databases, one for the calculations and one for production.

Thank you

Prash

Do you need to replicate back the calculations to the production database in order to support you webb application or are people running queries for pure analytic needs?

This can be reformulated as "are you running reports/analytic applications on your production database?

If so, I would recommend you to build a data warehouse/datamart.

What SSAS2005 can help you with is to aggregate information fast from the records in your data warehouse/dm. It can also help you with complex calculations because MDX(the query language that this product use) is stronger and requires less code than using TSQL/Stored procedures.

HTH

Thomas Ivarsson

|||

Thanks for your reply.

Do you need to replicate back the calculations to the production database in order to support you webb application or are people running queries for pure analytic needs?

Since all the calculations are done and stored in specific tables for the Reports, I just need to copy the database to production. No further calculations are involved.

Pardon me for my questions (Iam a beginner). Say, I have a dataware house which is built using the traditional snowflake/star schema model. Then I would assume that these steps need to be taken.

a) Built the relational database, such that no calculations are done

b) Built the dataware house/datamart and then perform the calculations(complex calculations) using the SSAS2005 by deploying the necessary cubes

c)Then, I could use reporting services to connect to the cubes for generating the reports.

If this is the procedure, then how do I connect my dataware house and the relational database(Integration services ?). Can you throw some light on the procedure, I need to follow.

Once again, thank you for your help.

-Prash

|||

Please see my comments:

a) Built the relational database, such that no calculations are done

You build a staging area which are tables that are only used for pumping data from your production system. The connection ,between your source system and the staging area, and the pumping of data is done by SSIS. You empty all the tables in staging area every time that you extract new source data. From the staging area you then build SSIS packages to move, clean and(or aggregate data.

b) Built the dataware house/datamart and then perform the calculations(complex calculations) using the SSAS2005 by deploying the necessary cubes

You can make some simple calculations in the data wareshouse for performance reasons. The rest is correct.

c)Then, I could use reporting services to connect to the cubes for generating the reports.

Correct. The only problem with reporting services is that it do not have the flexibility of a OLAP-client. Excel 2007 will support all functionality in SSAS2005. Reporting Services is best for standard reports.

If this is the procedure, then how do I connect my dataware house and the relational database(Integration services ?). Can you throw some light on the procedure, I need to follow.

Yes. You will use SSIS for this. Have a look at http://www.msftdwtoolkit.com/ and especially the book" The Microsoft Data Warehouse Toolkit".

HTH

Thomas

|||

Thank you. That's enough for me to get started. Can you suggest me any tutorials for building a dataware house depending on the existing relational database.

Cheers

Prash