-->
Showing posts with label DW/BI. Show all posts
Showing posts with label DW/BI. Show all posts

Sunday, August 5, 2012

Data Warehouse / Business Intelligence Solution for Dynamics GP–Part 2 Kimball Approach

Microsoft recommends the industry standard Kimball approach for DW/BI solutions. I have put in some Microsoft white papers below to get you started. I am assuming as more ERP consultants play part in DW/BI solutions, we will see more people learning and mastering the Kimball approach.

As I wrote in my previous post, most of it is common sense – to do this more efficiently, and to deliver predictable and useful results.

Common Challenges with BI/Reporting Solutions for Dynamics GP

Most seasoned consultants have techniques supplemented by formal project management to address these issues. At the same time, most of you would have faced some of these -

  • We need access to data from our old system, and make consolidated statements using data from Dynamics GP
  • Business Users are trying to analyse the data, but the GP database is “too complicated”
  • Integration stopped working because something was changed from the source system. 
  • Data maintained at multiple places in multiple systems – example – Sales department maintains list of customers in excel, marketing in their custom application, and Accounting in Dynamics GP. This causes multiple customer lists, out of sync with each other.
  • Data from an integrating system updated the data in GP, and now our reports for last month have changed
  • XYZ Report is running slowly.
  • Data from integrating system was imported around 12 AM,  and half the transactions were imported in Day 1, and half in Day 2
  • The integration has been failing for one week, and nobody realized
  • Our in-house integration expert has left and now nobody knows how to fix an issue with the interface!
  • The integration takes very long to run every night 

The Kimball approach has some guidelines which help you avoid all of these common issues.  I would highly recommend reading the following whitepapers from Microsoft and ofcourse the Kimball books

Kimball Life Cycle

image

Core Principles of Kimball Approach

  • Understand business requirements so you can engage the business, prioritize your efforts, and deliver business value.
  • Design the data warehouse data sets for flexibility, usability, and performance.
  • Build and deliver quick, business process-based increments within an enterprise data framework known as the data warehouse bus matrix.
  • Design and build a DW/BI system architecture based on your business requirements, data volumes, and IT systems environment.
  • Build out the extract, transformation, and loading (ETL) system with standard components to deal with common design patterns found in the analytic data environment.
  • Provide the complete solution, including reports, query tools, applications, portals, documentation, training, and support.

The Kimball approach starts with understanding business requirements for a data warehousing/Business intelligence solution. The ideal starting point for most organizations is to perform an initial set of interviews to gather and prioritize enterprise-wide high level business requirements for information. The result is a priority ordered list of business processes that generate data, along with high value analytic opportunities supported by that data.

image

Once the list of business processes and associated opportunities has been identified and prioritized, the next step is to take the highest priority business process and gather detailed business requirements related to it. This second pass at requirements is much more focused on understanding the specifics around the required data source, including attributes, definitions, business rules, data quality, and the range of analytics and applications that will be built on top of this data set.

Once these detailed requirements are in place, the Lifecycle moves into the implementation phase beginning with design steps across three different tracks. The top track in Figure 1 is the technology track – in case of Dynamics GP – we have wide variety of options

  • eConnect/SSIS/Web Services/SmartConnect for the ETL Layer
  • SSAS/SSRS/Business Objects/SmartList Builder/PowerPivot/ 3rd party tools like BI 360 for the BI Layer

The middle track in Figure 1 is the data track. The initial step is to define the logical data model needed to support the analytic requirements. In the Kimball approach, this is a dimensional model. Once the logical model is in place, the team can build the target database in the database environment. The nature of the physical model depends on the target platform. Many database products work best with a physical dimensional model, although a more normalized model may make sense on a few platforms.

The last data step is to create the ETL system that will populate the target database as required. The ETL system is a significant effort, often consuming a majority of the initial project resources.

  • In Dynamics GP – you will often be using an interface like eConnect/SmartConnect/Web Services for importing data (to meet the business rules for Dynamics)
  • You will be using one of the tools above OR SSIS for exporting the data

The bottom track in Figure 1 is concerned with the BI applications: the initial set of reports and analyses that will deliver business value to the organization. This track is split into two steps; the first is the design step where a small set of high value applications and reports are identified and specified in detail. The second step is the actual implementation where these applications and reports are built. This step often has to wait until near the end of the ETL development when data is actually available in the database. Note that these reports and analyses only serve as a starting point that helps solve a high-value problem. The dimensional model is not limited in any way to this subset of reports.

Once the three implementation tracks are complete, the Lifecycle comes back together to deploy the query tools, reports, and applications to the user community. This involves extensive communication, training, documentation, and support.

The next Lifecycle iteration usually begins during the deployment of the previous iteration, when the business analysts and designers can gather detailed requirements for the next highest priority business process, create the associated dimensional model, and start the process all over again. The Lifecycle’s incremental approach is a fundamental element that delivers business value in a short timeframe, while building a long-term, enterprise information resource.

Some concepts from the Kimball Approach

Star Schema

image

Star Schema is the recommended dimensional model in the Kimball Approach. The numeric measurements ("facts") of a business process are concentrated in the central fact table, and the context of the measurement is represented as a set of denormalized dimension tables, which surround the fact table. They keys that implement the joins between the dimension tables and the fact table should be anonymous integer keys. These are called surrogate keys.

SQL Server 2008 has built-in performance optimizations that leverage the dimensional model (search the web for “star join optimization” for more information on this).

Usability

Having a dimensional model sitting on top of Dynamics GP Databases makes it incredibly more easy for users to understand in comparison with the thousands of SQL Server tables.

  • Having a Dimensional model for Dynamics GP really helps in reporting/business users understand and use the data

image

Flexibility

Dynamics GP has a highly normalized database, which is great from a transaction processing perspective. Flexibility in terms of a Data Warehouse means – it should be flexible for different reporting requirements.

  • With a base dimensional model with facts and dimensions – users can built multiple reports

Flexibility comes in part from the level of detail captured in the model. A strong design goal in the dimensional model is to always capture data at the lowest level of detail available, called the atomic level. The presence of atomic-level data allows users to roll the data up to any level of summarization required. Any aggregation prior to inclusion in the enterprise data warehouse means some detail will not be available, thus reducing flexibility.

Performance and Maintenance

The dimensional model keeps the atomic-level fact tables in their normalized form (by normalizing the dimension tables out of the fact table) for smaller size and better performance, but keeps each dimension in denormalized (flat) form. Note that such flat dimension tables contain exactly the same information as fully normalized (snowflaked) dimension tables but do not implement the separate tables and extra keys required to complete the normalization process. The dimensional model simplifies the physical design by dramatically reducing the number of tables and joins required for a given analytic query, which improves performance on most market leading database products running on single servers. 

  • Using data from a DW like SSAS reduces the load on GP Databases
  • Additionally, as the SSAS cube is built for reporting, with a highly denormalized structure – you need lesser joins  

I discussed some performance statistics in my previous post.

Conformed Dimensions and Enterprise Bus Matrix

Take a look at a sample bus matrix below - the row headers down the left side define the organization's primary business processes. The column headers of the bus matrix represent the primary objects that participate in those business processes. Typical examples include customer, account, product, store, employee, patient, and date. These objects are called dimensions, and they must be pre-integrated to work with all the relevant business processes.


This pre-integration is called conforming, and it involves the hard organizational data governance work of deciding the standard names, descriptions, mappings, hierarchies, and business rules that will apply across the DW/BI system.

Once this definitional work is done, these dimensions become reusable components that can be applied to every associated business process. Most importantly, the conformed dimensions are the necessary framework for integration, where the results from two or more business process can be combined into a single BI deliverable.

 

Image(15)

Slowly Changing Dimensions

Every analytic data store must provide a means to accurately track dimension attributes as they change over time. Tracking attribute changes allows the business to report on the state of the world as it was at any point in time, answering question like “What were sales by territory as of December 31st last year?” It also supports accurate causal analysis by associating the attribute values that were in effect when an event occurred with the event itself. For example, what postal code did a customer live in when they bought a certain product two years ago?

The most efficient way to capture these changes from both an ease of use and performance perspectives is to add a row to the dimension whenever an attribute changes by assigning a new surrogate key and capturing the effective date and end date for each row. These are commonly referred to as slowly changing Type 2 dimensions. You can see these control columns below.

While tracking attribute changes over time places a burden on the ETL process, it improves performance for user queries because the joins between the facts and dimensions are simple equijoins on integer keys. This also improves ease of use because the BI semantic layer does not have to handle more complex, multi-column unequal joins in order to retrieve the correct dimension row for any given historical fact event.

Tracking changes over time is a mandatory business requirement, regardless of the underlying data model you use. It is possible to track changes in a normalized model, but the complexity of keeping multiple versions across dozens of tables associated with a single dimension is much greater than dealing with changes in a single, denormalized dimension table.

 

image

Naturally this is a satellite view to the Kimball Approach – there are multiple books over 800 pages each, difficult to summarize in one post.

This was part 2 of this series.

  1. Overview of Kimball Approach for a scalable BI solution for Dynamics GP
  2. Kimball Approach for gathering BI requirements
  3. Master Data Management with Dynamics GP
  4. Building a robust ETL (Extract Transform Load) system for initial and ongoing load into Dynamics GP
  5. Building a Data warehouse for Dynamics GP (following best practises)
  6. Building a BI solution for Dynamics GP (following best practises)
  7. Reviewing the existing DW/BI toolset for Dynamics GP
  8. Analysis Cubes Module for Microsoft Dynamics GP (how it implements parts of Kimball approach)
  9. Latency for Dynamics GP BI (real time vs next day)
  10. Data Mining for Dynamics GP
  11. Security and Metadata for a DW/BI solution

Tuesday, July 31, 2012

Creating an Enterprise Data Warehouse (EDW) for Consolidated Business Intelligence (CBI) Series

After my DW/BI post yesterday, a reader mailed me pointing me to the Creating an Enterprise Data Warehouse (EDW) for Consolidated Business Intelligence (CBI) Series by John Lowther.  John has some great ideas – and recommendations, so check it out.

Here’s the summary from John’s blog -

RECAP

As the last post in this series, I wanted to recap and try to give a high level of what we wish to accomplish.

If you remember on the first post we wanted to achieve two things, and that was not to hurt the performance of the Applications or of the BI Solution.

In the second post, we defined some generic ways of thinking about data in general. Things like concentric data, superfluous data, solitary data, relational data, etc.

Then we look at a way to keep the number of SQL Jobs down so that we have a maintainable system in the end.

Then we looked at a way to monitor the system to make sure that performance does not degrade over time.

We even touched on a way of getting data from on system to another, and started up another set of related posts on that subject, specifically named "Getting data from Point A to Point B".

Monday, July 30, 2012

Data Warehouse / Business Intelligence Solution for Dynamics GP–Part 1 Overview

Over the last few years we have seen a wide variety of BI solutions for Dynamics GP. As we see more and more mid to large sized Dynamics GP Implementations (40 to 100+ users) – having robust DW/BI (Data Warehousing/Business Intelligence) solutions is becoming a necessity. You can have excellent BI tools ( SSRS / BI 360 /Smartlist Builder / Crystal / Excel Refreshable reports) – but you need a scalable solution that works for a large user base.

As it is with most processes, there are best practices to achieve your goals. When I was programming, I really enjoyed reading about and implementing Design Patterns and Refactorings – that changed programming for me. Implementing these common sense techniques saved me time, and helped deliver robust solutions.

kimball

There are similar best practises for Data Warehousing and Business Intelligence. Kimball’s approach is very popular – it’s always been highly recommended in the DW/BI world. My aim with this post and the next few posts is to introduce you to the Kimball approach, and associate how it ties up with Dynamics GP Implementations. However, first lets take a look at OLAP – and where that fits into the GP world.

If you look at the system requirements for Dynamics GP – you will see that

  • For 20-60 users – Microsoft recommends - Perform some online analytical processing (OLAP) cube generation
  • For 60 – 100 users – Microsoft recommends – Perform online analytical processing (OLAP) cube generation (to different machine)

Microsoft provides a module – Analysis Cubes – which implements most best practices and can help significantly with performance. At the same time, its important to understand what goes behind the scenes, as you would often be integrating with multiple systems – and have custom requirements.

So what are the advantages of reporting from a dimensional OLAP database like SSAS vs. directly reporting from Dynamics GP SQL Database ?

1. OLAP database technology is optimized for querying and reporting, instead of processing transactions.

The Dynamics GP Database is designed as a highly normalized OLTP database. There are lots of small tables with relationships defined between them. This is good for additions, deletions, and modifications of a field, which can be made in just one table and then propagated through the rest of the database via the defined relationships. However, if you have written reports for GP – you would know it often involves creating multiple joins. This is fine for smaller implementations, but as the number of users and transactions increase – can lead to performance bottlenecks.

Here is a simple SQL view (Sales by Item by Month – by Victoria Yudin)

   1:   
   2:   
   3:  SELECT
   4:  D.ITEMNMBR Item_Number,
   5:  D.Item_Description,
   6:  D.Generic_Description,
   7:  D.Item_Class,
   8:  D.User_Category_1,
   9:  sum(case when month(D.DOCDATE) = 1 then D.SALES else 0 end) as [Jan_Sales],
  10:  sum(case when month(D.DOCDATE) = 2 then D.SALES else 0 end) as [Feb_Sales],
  11:  sum(case when month(D.DOCDATE) = 3 then D.SALES else 0 end) as [Mar_Sales],
  12:  sum(case when month(D.DOCDATE) = 4 then D.SALES else 0 end) as [Apr_Sales],
  13:  sum(case when month(D.DOCDATE) = 5 then D.SALES else 0 end) as [May_Sales],
  14:  sum(case when month(D.DOCDATE) = 6 then D.SALES else 0 end) as [Jun_Sales],
  15:  sum(case when month(D.DOCDATE) = 7 then D.SALES else 0 end) as [Jul_Sales],
  16:  sum(case when month(D.DOCDATE) = 8 then D.SALES else 0 end) as [Aug_Sales],
  17:  sum(case when month(D.DOCDATE) = 9 then D.SALES else 0 end) as [Sep_Sales],
  18:  sum(case when month(D.DOCDATE) = 10 then D.SALES else 0 end) as [Oct_Sales],
  19:  sum(case when month(D.DOCDATE) = 11 then D.SALES else 0 end) as [Nov_Sales],
  20:  sum(case when month(D.DOCDATE) = 12 then D.SALES else 0 end) as [Dec_Sales]
  21:   
  22:  FROM
  23:  (SELECT SH.DOCDATE, SD.ITEMNMBR,
  24:   coalesce(I.ITEMDESC, SD.ITEMDESC) Item_Description,
  25:   coalesce(I.ITMGEDSC, '') Generic_Description,
  26:   coalesce(I.ITMCLSCD,'') Item_Class,
  27:   coalesce(I.USCATVLS_1,'') User_Category_1,
  28:   CASE SD.SOPTYPE
  29:       WHEN 3 THEN SD.XTNDPRCE
  30:       WHEN 4 THEN SD.XTNDPRCE*-1
  31:       END SALES
  32:   FROM SOP30200 SH
  33:   INNER JOIN
  34:       SOP30300 SD
  35:       ON SD.SOPNUMBE = SH.SOPNUMBE
  36:       AND SD.SOPTYPE = SH.SOPTYPE
  37:   LEFT OUTER JOIN
  38:       IV00101 I
  39:       ON I.ITEMNMBR = SD.ITEMNMBR
  40:   WHERE SH.VOIDSTTS = 0
  41:       AND SH.SOPTYPE IN (3,4)
  42:       AND SD.XTNDPRCE <> 0
  43:       AND SD.ITEMNMBR not like 'XXXXXXXXXXXXXXX%'
  44:       AND year(SH.DOCDATE) = 2017 --change year as needed 
  45:       ) D
  46:   
  47:  GROUP BY D.ITEMNMBR, D.Item_Description, D.Generic_Description, D.Item_Class, 
  48:  D.User_Category_1
  49:   

Here are the results from Fabrikam

image

Its getting data from multiple tables, and aggregating data on the fly. If we look at this query in the profiler – it takes about 57 ms to execute.

image

A OLAP system like SQL Server Analysis services, is designed for reporting and analysis. There are pre-processed aggregations, and proactive caching which helps in generating report in a fraction of a time that it would normally take.

Here is the corresponding MDX (query language for SSAS – you can often get away with the generated MDX from the designer and Excel power pivot)

   1:  SELECT NON EMPTY { [Measures].[Extended Price - Detail] } ON COLUMNS,
   2:  NON EMPTY
   3:  {
   4:    ( [Items].[Item No].[Item No].AllMembers * [Master Date].[Month].[Month].AllMembers )
   5:  } Dimension Properties MEMBER_CAPTION,
   6:  MEMBER_UNIQUE_NAME ON ROWS
   7:  FROM (
   8:    SELECT ( { [Master Date].[Year].[All Date].[2016] } ) ON COLUMNS
   9:    FROM [Sales]
  10:  )
  11:  WHERE ( [Master Date].[Year].[All Date].[2016] ) CELL Properties Value,
  12:  BACK_COLOR,
  13:  FORE_COLOR,
  14:  FORMATTED_VALUE,
  15:  FORMAT_STRING,
  16:  FONT_NAME,
  17:  FONT_SIZE,
  18:  FONT_FLAGS

Here is the result output

image

SSAS has pre-calculated measures

image

If you look at this MDX query being executed in profiler, it takes about 10 ms to execute.

image

As you can see for the same result output SSAS delivers a much better performance, as the SSAS database is built for Analysis and reporting.

2. Analysis Cubes for Dynamics GP can serve as an easier reporting platform for end users.

Dynamics GP with its complex Database structure can be a nighmare for end users to report on. With user friendly dimensions and measures, end users can use tools like SSRS and Excel to report on data.

Consider end users digging data from the Dynamics GP database versus

image

Users digging data from well defined dimensional model in SSAS (accessed from within Excel easily)

image

3. Users can view data in Excel, without requiring access to Dynamics GP.

For example, Analysis Cubes can be used to view all the checks that have cleared the bank, or the total purchases made by a customer, and these Excel users do not need access to Microsoft Dynamics GP. Information from Dynamics GP Analysis Cubes can be viewed in pivot tables in Microsoft Excel. Analysis Cubes can be used to spot trends by producing analytical views of sales information, buying patterns, and other values.

Hopefully, if you have read this far, I have you interested in why this is something you need to be considering for your growing BI requirements.

UPDATE : The new licensing for Dynamics GP seems to have Analysis Cubes in starter pack, which would mean it would be even more lucrative to implement this for your Dynamics GP implementation.

Over the next few posts I am aiming to look at

  1. Overview of Kimball Approach for a scalable BI solution for Dynamics GP
  2. Kimball Approach for gathering BI requirements
  3. Master Data Management with Dynamics GP
  4. Building a robust ETL (Extract Transform Load) system for initial and ongoing load into Dynamics GP
  5. Building a Data warehouse for Dynamics GP (following best practises)
  6. Building a BI solution for Dynamics GP (following best practises)
  7. Reviewing the existing DW/BI toolset for Dynamics GP
  8. Analysis Cubes Module for Microsoft Dynamics GP (how it implements parts of Kimball approach)
  9. Latency for Dynamics GP BI (real time vs next day)
  10. Data Mining for Dynamics GP
  11. Security and Metadata for a DW/BI solution