{"id":482,"date":"2017-09-12T02:14:38","date_gmt":"2017-09-12T02:14:38","guid":{"rendered":"http:\/\/people.utm.my\/suraya\/?p=482"},"modified":"2017-09-12T02:14:38","modified_gmt":"2017-09-12T02:14:38","slug":"dimensionality-modeling","status":"publish","type":"post","link":"https:\/\/people.utm.my\/suraya\/2017\/09\/12\/dimensionality-modeling\/","title":{"rendered":"Dimensionality Modeling"},"content":{"rendered":"<p><b>Dimensions<\/b>\u00a0are the foundation of the\u00a0<b>fact table<\/b>, and is where the data for the\u00a0<b>fact table<\/b>\u00a0is collected. Typically\u00a0<b>dimensions<\/b>\u00a0are nouns like date, store, inventory etc. These\u00a0<b>dimensions<\/b>\u00a0are where all the data is stored. For example, the date\u00a0<b>dimension\u00a0<\/b>could contain data such as year, month and weekday.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-483\" src=\"https:\/\/people.utm.my\/suraya\/wp-content\/uploads\/sites\/615\/2017\/09\/contoh-fact-and-dimensional-table-300x294.jpg\" alt=\"\" width=\"300\" height=\"294\" srcset=\"https:\/\/people.utm.my\/suraya\/wp-content\/uploads\/sites\/615\/2017\/09\/contoh-fact-and-dimensional-table-300x294.jpg 300w, https:\/\/people.utm.my\/suraya\/wp-content\/uploads\/sites\/615\/2017\/09\/contoh-fact-and-dimensional-table-768x754.jpg 768w, https:\/\/people.utm.my\/suraya\/wp-content\/uploads\/sites\/615\/2017\/09\/contoh-fact-and-dimensional-table.jpg 798w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3>WHAT IS A FACT TABLE? (EVENT) = verbs?<br \/>\n<span style=\"font-size: 10pt\">err.. my assumption, fact table related to the activities<\/span><\/h3>\n<p>Fact tables contain the data corresponding to a particular business process. Each row represents a single event associated with that process and contains the measurement data associated with that event.<\/p>\n<div id=\"billboard1-sticky_1-0\" class=\"comp billboard1-sticky billboard-sticky is-lockable\">\n<div class=\"spacer\">\n<div id=\"billboard1_1-0\" class=\"comp billboard1 mntl-gpt-adunit gpt billboard\">\n<div id=\"billboard\" class=\"wrapper\">\n<div id=\"google_ads_iframe_\/479\/thoughtco\/tho_databases\/billboard_0__container__\">For example, a retail organization might have fact tables related to customer purchases, customer service telephone calls, and product returns. The customer purchases table would likely contain information about the amount of the purchase, any discounts applied and the sales tax paid.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"cb-split\">\nThe information contained within a fact table is typically numeric data and it is often data that can be easily manipulated, particularly by summing together many thousands of rows. For example, the retailer described above may wish to pull a profit report for a particular store, product line or customer segment. The retailer can do this by retrieving information from the fact table that relates to those transactions meeting the specific criteria and then adding those rows together.<\/p>\n<h3>FACT TABLE GRAIN<\/h3>\n<p>When designing a fact table, developers must pay careful attention to the grain of the table &#8212; the level of detail contained within the table.<\/p>\n<p class=\"cb-split\">The developer designing the purchase fact table described above would need to decide, for example, whether the grain of the table is a customer transaction or an individual item purchase. In the case of an individual item purchase grain, each customer transaction would generate multiple fact table entries, corresponding to each item purchased.<\/p>\n<p class=\"cb-split\">The choice of grain is a fundamental decision made during the design process that can have \u200ba\u00a0significant impact on the business intelligence effort down the road.<\/p>\n<h3>WHAT ARE DIMENSIONS? (Mostly noun)<\/h3>\n<p>Dimensions describe the objects involved in a business intelligence effort. While facts correspond to events, dimensions correspond to people, items, or other objects. For example, in the retail scenario, we discussed that purchases, returns, and calls are facts. On the other hand, customers, employees, items and stores are dimensions and should be contained in dimension tables.<\/p>\n<p>Dimension tables contain details about each instance of an object. For example, the items dimension table would contain a record for each item sold in the store. It might include information such as the cost of the item, the supplier, color, sizes, and similar data.<\/p>\n<p>Fact tables and dimension tables are related to each other. Again returning to our retail model, the fact table for a customer transaction would likely contain a\u00a0<a href=\"https:\/\/www.thoughtco.com\/foreign-key-definition-1019255\">foreign key<\/a>\u00a0reference to the item dimension table, where the entry corresponds to a\u00a0<a href=\"https:\/\/www.thoughtco.com\/primary-key-definition-1019179\">primary key<\/a>\u00a0in that table for a record describing the item purchased.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dimensions\u00a0are the foundation of the\u00a0fact table, and is where the data for the\u00a0fact table\u00a0is collected. Typically\u00a0dimensions\u00a0are nouns like date, store, inventory etc. These\u00a0dimensions\u00a0are where all the data is stored. For example, the date\u00a0dimension\u00a0could contain data such as year, month and &hellip; <a href=\"https:\/\/people.utm.my\/suraya\/2017\/09\/12\/dimensionality-modeling\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-data-warehouse"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.utm.my\/suraya\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}