<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Xiaodong (Tony) Zhang on Medium]]></title>
        <description><![CDATA[Stories by Xiaodong (Tony) Zhang on Medium]]></description>
        <link>https://medium.com/@mstr-tony?source=rss-be7b6de4a0d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9XhA7KjqcVTGTEEgRz22Cg.jpeg</url>
            <title>Stories by Xiaodong (Tony) Zhang on Medium</title>
            <link>https://medium.com/@mstr-tony?source=rss-be7b6de4a0d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:41:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mstr-tony/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using semantic layers with data marts]]></title>
            <link>https://medium.com/kyligence/using-semantic-layers-with-data-marts-cb3dd482ee9d?source=rss-be7b6de4a0d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb3dd482ee9d</guid>
            <category><![CDATA[data-mart]]></category>
            <category><![CDATA[bi]]></category>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Xiaodong (Tony) Zhang]]></dc:creator>
            <pubDate>Fri, 27 May 2022 17:24:05 GMT</pubDate>
            <atom:updated>2022-05-27T17:24:05.517Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>This article will describe how to implement semantic layers with data marts, as well as their definitions, user cases, and benefits.</em></strong></p><h3>What is a semantic layer?</h3><blockquote>A <a href="https://kyligence.io/blog/semantic-layer-the-bi-trend-you-dont-want-to-miss-in-2020/">semantic layer</a> is a business abstraction derived from the technical implementation layer <strong>— a model layer that uniformly maintains business logic, hierarchies, calculations, etc. This frees business users from concerns about the technical complexity and implementation of the underlying data source. </strong>A data consumer (no matter his/her data literacy) needs to be able to easily discover, understand, and utilize the data. <strong>The semantic layer provides business users with an easy way to understand the data.</strong></blockquote><p>A semantic layer contains the core logic required for business analysis, transforming the underlying data model into familiar business definitions (dimensions, measures, hierarchies) and easy-to-understand terms. It can contain commonly used derived measures, such as year-over-year, month-over-month, month-to-date, etc. <strong>Users can directly consume the calculated measures and reuse the semantics in different downstream applications.</strong></p><p>Through a variety of query interfaces, the unified semantic layer serves as the endpoint for data analysis. This endpoint may be a BI tool or a customized application. So the end-users of the semantic layer should be the ones who will use the data for analysis, and they may be data analysts, business analysts, decision-makers, and report designers, not engineers and developers.</p><p>In the same digital world, there are diverse users, for example, business analysts, data analysts, data engineers, and data scientists, who each tell their own data story and need a unified data definition to translate their insights into data. The semantic layer is one such platform, storing not data but metadata. It acts as a single version of the truth, serving a diverse set of users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMEF831Macyf2J7QigRPpQ.png" /></figure><h3>What is a data mart?</h3><p>Traditionally, a data mart is a structure/access pattern used to retrieve client-facing data in data warehouse setups. A data mart is a subset of a data warehouse that is typically focused on a single business line or team.</p><p>Nowadays, it is also possible to build a data mart structure on top of a data lake, as some vendors are using the term “lakehouse” to refer to building a data mart on top of the data lake.</p><p>Whereas data warehouses or data lakes have enterprise-wide depth, the information in data marts pertains to a single department. Each department or business unit may be considered the owner of its data mart, which includes all hardware, software, and data in some installations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*SHXn8UbiXi4Ng-5qjECcGw.png" /><figcaption>Wikipedia</figcaption></figure><p>Often data mart is the last layer in the traditional data warehouse structure. Its position locates before connecting with business intelligence tools.</p><h3>Advantages of the data mart</h3><ul><li>A fraction of an organization’s data is stored in data marts. This information is useful to a specific group of people within a company.</li><li>It is a cost-effective alternative to a data warehouse, which can take high costs to build.</li><li>Data mart allows faster access to data.</li><li>Data mart is simple to use since it is tailored to the needs of its customers. As a result, a data mart can speed up corporate processes.</li><li>Data marts need less implementation time compared to data warehouse systems. It is faster to implement a data mart as you only need to concentrate the only subset of the data.</li><li>It contains historical data that allows the analyst to spot patterns in the data.</li></ul><h3>How a semantic layer integrates with data marts</h3><p>The semantic layer can be located in many layers, for example, in BI, on top of the logical data warehouse (LDW) or data mart. Defining the semantic layer with the data mart is an option for the semantic layer on top of the logical data warehouse (LDW).</p><p>The traditional semantic layer, which is linked to traditional A&amp;BI tools, functions as a data mart, providing a layer of logic as well as a store of analytics-ready data with the context to support self-service by unskilled users. Data collection, on the other hand, can only go so far. As a result, new approaches centered on connecting to data have gained popularity.</p><p>For example, <a href="https://help.tableau.com/v2020.2/pro/desktop/en-us/datasource_datamodel.htm#star-and-snowflake-schema-analysis">Tableau 2020.2 introduced a logical (semantic layer) model layer</a> to assist users in associating more data models. With the addition of this function, each Tableau data source can now support the analysis of multiple fact tables as well as complex analysis scenarios like many-to-many relationships (previously, it could only support a single fact table).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_DUxDBqc8WVloZjRoY4MA.png" /></figure><p>Tableau logical layer — Each logical table contains physical tables in a physical layer.</p><p>Tableau now has a new semantic layer that improves its capacity to execute complicated modeling and analysis, as you can see. Tableau’s software ecosystem may take advantage of this freshly released data source. More business users can utilize the logical model in the shared data source through their browsers as a result of publishing this logical model layer to Tableau Server, and IT can monitor the published data source and control/authorize user rights to data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ttx8lHDsDRbCO0-kBZ-dg.png" /><figcaption>Tableau Data Server</figcaption></figure><p>Tableau’s semantic layer is designed for IT-centered model management with self-service features. The modeling technique is simple and straightforward, with a short learning curve. Tableau’s semantic layer appeals to me because of its transparent and seamless modeling style.<strong> Tableau’s semantic layer, on the other hand, does not operate with other BI products.</strong> Large corporations and their many business segments frequently use different BI products. Therefore the Tableau semantic layer can be highly restricted for these organizations.</p><p>The traditional IT-built semantic layer failed for two fundamental reasons:</p><ul><li>They were difficult to set up and manage;</li><li>They were difficult for end-users to use, alter, and update, which meant that now the semantic layer was often a platform exclusively utilized by IT. This reliance on IT slowed down the semantic layer platform’s deployment and usability.</li></ul><p>As a result, we advocate putting semantics on the edge of a logical data warehouse. Because the logical data warehouse (LDW) is built to meet 95% of analytics requirements. LDWs offer a wide range of analytic engines, allowing them to accommodate a diverse collection of users and applications. As a result, including the semantic layer in the LDW is frequently recommended.</p><p>In this approach, the semantic layer functions as a data mart sitting on top of an LDW. It can source data from other data stores, but the data warehouse is specifically modeled as a star schema or snowflake schema to support the semantic layer. In the semantic layer, modelers can enhance the data by adding hierarchies, calculated measures, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*sx_nx28xnTNygdeutgyQZQ.png" /></figure><p>Users can build a semantic layer with a data mart to ensure the data definition and consistency inside a department, unit, or set of users in an organization. E.g., Marketing, Sales, HR, or finance. Let’s look at the user cases of data mart with semantic layers within different industries and what business value can be generated.</p><h3>Benefits of using a semantic layer with a data mart</h3><p>A data mart is defined as a subset of a data warehouse that is focused on a single functional area of an organization. The semantic layer is the layer that BI tools usually connect to. Building a semantic layer with a data mart can implement many key benefits below.</p><ul><li>Shared Business Logic</li></ul><p>A semantic layer contains the core logic required for business analysis, transforming the underlying data model into familiar business definitions (dimensions, measures, hierarchies) and easy-to-understand terms. It can contain commonly used derived measures, such as year-over-year, month-over-month, month-to-date, etc. A semantic layer with a specific data mart can unify the data definitions in a specific area. Users in their specific areas can directly consume the calculated measures and reuse semantics in different downstream applications.</p><ul><li>Unified Security Policy</li></ul><p>A semantic layer ensures users and data access controls are uniformly applied in all downstream analysis or business applications. Data mart makes sure different areas of data get isolated, so IT doesn’t need to configure data access control for individual downstream systems.</p><ul><li>High-Performance Backend Engines</li></ul><p>The semantic layer must have a powerful built-in engine or be able to connect to a big data engine such as Spark. The unified semantic layer can bring businesses a more comprehensive view of their data so that businesses can conduct analysis on massive, detailed datasets. This cannot be done without a powerful backend engine.</p><ul><li>Enable interactive analytics for the end-user</li></ul><p>A data mart can unify data from multiple sources. It provides an interface that BI tools use to enable ad-hoc analysis with drag and drop. Through a variety of query interfaces, the unified semantic layer with a data mart serves as the endpoint for data analysis. This endpoint may be a BI tool or a customized application.</p><h3>Use cases for semantic layers with data marts</h3><ul><li>Finance</li></ul><p>The financial industry has many data analysts who find the best portfolio of investments and calculate the risk factors of different markets. Financial analysts can use semantic layers to calculate the aggregated returns of multiple investment products, as well as risk factor assessments for large portfolios.</p><ul><li>Retail</li></ul><p>The semantic layer enables retailers across channels to integrate all data from POS systems, e-commerce, customer service, and marketing programs into one source. This enables analysts to assist marketers in creating better campaigns and experiences that meet customer expectations.</p><ul><li>Manufacturing</li></ul><p>One of the biggest pain points in manufacturing is finding the production processes that need the most optimization. With easy access to data, manufacturing companies can build process forecasting tools to calculate the “best process” and execute against it.</p><ul><li>Medical</li></ul><p>With access to all relevant data, analysts can use semantic layers to analyze patients who are deteriorating and then allocate medical resources to the right patients, improving the management of medical resources.</p><blockquote>Research</blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Data_mart">https://en.wikipedia.org/wiki/Data_mart</a></blockquote><blockquote><a href="https://kyligence.io/blog/semantic-layer-the-bi-trend-you-dont-want-to-miss-in-2020/">https://kyligence.io/blog/semantic-layer-the-bi-trend-you-dont-want-to-miss-in-2020/</a></blockquote><blockquote><a href="https://kyligence.io/blog/powering-the-democratization-of-data-analytics-with-tableau/">https://kyligence.io/blog/powering-the-democratization-of-data-analytics-with-tableau/</a></blockquote><blockquote><a href="https://www.gooddata.com/blog/how-build-semantic-layers-massive-scale-analytics/">https://www.gooddata.com/blog/how-build-semantic-layers-massive-scale-analytics/</a></blockquote><blockquote><a href="https://enterprise-knowledge.com/what-is-a-semantic-architecture-and-how-do-i-build-one/">https://enterprise-knowledge.com/what-is-a-semantic-architecture-and-how-do-i-build-one/</a></blockquote><blockquote><a href="https://www.atscale.com/blog/what-is-a-universal-semantic-layer-why-would-you-want-one">https://www.atscale.com/blog/what-is-a-universal-semantic-layer-why-would-you-want-one</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb3dd482ee9d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kyligence/using-semantic-layers-with-data-marts-cb3dd482ee9d">Using semantic layers with data marts</a> was originally published in <a href="https://medium.com/kyligence">Kyligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dive into Winter Olympics Games: Data Analysis and Visualization]]></title>
            <link>https://medium.com/@mstr-tony/dive-into-winter-olympics-games-data-analysis-and-visualization-5b2fe1e511ab?source=rss-be7b6de4a0d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b2fe1e511ab</guid>
            <category><![CDATA[olympics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Xiaodong (Tony) Zhang]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 06:06:26 GMT</pubDate>
            <atom:updated>2022-01-24T06:06:26.595Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Eg4YNsYiw5GsSP6_" /><figcaption>The Olympic Rings stand in a skiing field</figcaption></figure><h3>1. Introduction</h3><p>The 2022 Winter Olympics, officially the XXIV Olympic Winter Games, is around the corner scheduled to take place from February 4 to 20, 2022 in Beijing, China. It is a major international multi-sports event held once every four years, and each country tries to give its best performance during the event. Inspired by the upcoming one, we would like to take you through the Winter Olympics history and learn more about various factors that lead to the performance of countries and players by analyzing and visualizing historical data.</p><h3>2. Data Preparation</h3><p>The initial data used in this analysis report was collected from Kaggle [1]. Key data includes all-time event information such as host places, athletes and teams, disciplines and events, and medal results. Referring to Olympics official data [2], all presented data have been verified and cleaned prior to performing analysis. The GDP and CPI data were sourced from World Bank Open Data [3, 4].</p><h3>3. Data Analysis and Discussion</h3><p>All the data were processed and analyzed in RStudio, and part of the visualization was performed by Tableau.</p><h3>3.1 Winter Olympics History</h3><p>3.1.1 Host country and geographic distribution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*76VvIzmkhv5Trk1L" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tMGUbR3KBokZyyNa" /></figure><p>The first Winter Olympic Games took place on February 25, 1924, in France. Until Jan 2022, a total of 23 games have been held in only 12 countries across three continents. The map clearly shows that all past games were organized in Europe, North America, and Asia, among which around 60% of the games took place in Europe. The United States is the nation that held the most of Winter Olympics with a count of four times. As the birthplace of the Winter Olympics, France hosted three times. Switzerland, Norway, Japan, Italy, Canada, Austria host twice. In Asia, only two countries once held the event: Japan and South Korea, and China is going to be the next one and join the list in Feb 2022. Beijing will become the first city to host both summer and winter Olympics by that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t4py-aMWJ-IIR7n9" /></figure><p>By visualizing the latitudes of all the host cities throughout the event history, it clearly shows that all the games were held in the Northern Hemisphere, above the Tropic of Cancer, with the latitude range from 36.75° (1998 Nagano, Japan) to 61.13° (1994 Lillehammer, Norway).</p><p>3.1.2 Participated Athletes and Teams</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YMLg1VsJFrN9eCbE" /></figure><p>There was a significant increase in athletes and teams throughout history, except a drop in 1932. A turning point came in 1980 (Lake Placid, US) since both participants grew rapidly in the subsequent events with a rate of 160% and 150%, respectively, in 48 years from 1980 to 2018.</p><p>Under normal circumstances, it is expected that the number of athletes and teams will reach a new record in Beijing in 2022. Due to CVOID-19 and the resulting uncertainties over the past two years, we could not predict how the figures would be affected until the opening of the game.</p><p>3.1.3 Disciplines and Events</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eHflRE-i85ghAeMj" /></figure><p>There was a total of nine competing disciplines in the first Winter Olympics. Military Ski Patrol was the only discipline that appeared once and then removed from the future games. Some disciplines experienced addition and removal during the games, such as Curling and Skeleton. In 1964, Bobsleigh and Luge were the first time becoming competing disciplines. Same for Freestyle Skiing and Shorting Track Speed Skating, which initially appeared in 1992; Snowboard joined the game in 1998. From 2002 to the upcoming game in 2022, the total count of disciplines remains the same as 15. While the number of events continuously increased over the games, which illustrates the growing trend of the athletes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DWqgr2QjMxTqirGR" /></figure><p>The above graph reveals the appearance of each discipline during each game, as indicated by the circle point. Meanwhile, it depicts how the participant changed over time by discipline. We can conclude that the top 3 disciplines that attract the most participants also with the fastest growth are Alpine Skiing, Biathlon, and Cross-Country Skiing, primarily driven by the rise in the event number in those disciplines.</p><h3>3.2 Game Results</h3><p>3.2.1 Teams have won medals in history</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QxoWm0Fsb20VGyRn" /></figure><p>A total of 46 countries or teams out of 127 have won medals in Winter Games history. The outstanding national teams are Austria, Canada, Finland, Norway, Sweden, and United States. They all participated in all 23 times of Winter Olympics and also won medals.</p><p>3.2.2 All-time medal ranking table Winter Olympics 1924–2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZlGZhKOYmGjTZxFE" /></figure><p>The above map shows that countries in Europe and North America have won the most medals in the past. Although Australia and New Zealand are surrounded by sea, they also experience snow and ice due to their complex climatic conditions. Their natural snowfields provide suitable conditions for ice and snow activities. Countries in Africa and South America have not won medals or even never participated in the Winter Games because their geographical conditions make it difficult to encounter snow and ice. Antarctica has snow and ice conditions all season, but unfortunately, the penguin team has not won any medal yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/0*I6lbGQaLRc9xvVsN" /></figure><p>Following the common rule of the ranking medal table, we order the team by the number of gold medals won, then take into consideration of silver medals and then the number of bronze medals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yQq5okJAyFmhfPtR" /></figure><p>Norway is the most successful nation of all time at the Winter Olympic Games, having amassed 368 medals since the first event in 1924 — this tally includes 132 gold medals, 125 silver, and 111 bronze. It is more impressive considering Norway only <a href="https://data.worldbank.org/indicator/SP.POP.TOTL?locations=NO&amp;name_desc=false">has a population</a> of just over five million inhabitants. The United States ranks №2 for all-time medals with 105 gold, 112 silver, and 88 bronze.</p><p>3.2.3 Historical medal distribution by discipline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vjv-vGm8ZW8X8Jyg" /></figure><p>You may wonder which discipline contributed the most and least set of medals in the Winter Olympics. Not hard to tell, Speed Skating, Cross Country Skiing, and Alpine Skiing are the top 3 disciplines that contribute the most medals. Whereas Skeleton, Curling, and Ice Hockley yield the least medals due to the small size of the event or the short history. We skip Military Ski Patrol and Alpinism because they only appeared once in the first Winter Games in history.</p><p>3.2.4 The strongest Country of all time for each discipline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H2_yTgefjMtWMjRH" /></figure><p>We would like to find out which country won the most medals in each discipline. The above plot indicates that Norway has traditionally dominated Cross Country Skiing, Nordic Combined, and Ski Jumping during Winter Olympics. Netherlands is a Speed Skating dominant force. Alpine countries traditionally dominate the Alpine Skiing event, and Austria has a commanding lead in gold medals. South Korea achieved the most gold medals in Short Tracking Speed Skating. German team dominates the Luge, Biathlon, and Bobsleigh. Russia won the most gold medals in Figure Skating and Snowboarding. Canada is strongest in Ice Hockey, Freestyle Skiing, and Curling.</p><h3>3.3 Ranking Analysis</h3><p>3.3.1 Historical performance by team</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*slOsteWmlFjqrDX7" /></figure><p>According to the rank table, 46 countries or teams have won at least one medal in Winter Games history. In order to effectively inspect the ranking change by team and ensure the sample size, we filter out the teams who appear in the ranking table less than ten times. Referring to the trendline of each team, the team performances of Finland, Great Britain, and Sweden were not as good as before since the trendlines go upwards, corresponding to a decrease in the rank. By contrast, the German team was getting stronger throughout the games. For Netherlands, Switzerland, and Unites States, they remained strong with consistent performance over the games.</p><p>3.3.2 Did the team performs better at home field?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mnVNlxuKNP7lsJpV" /></figure><p>We are curious if a team had a better performance when the game was hosted at home. Based on the medal ranking table, we rank the team by the event year. We filter the national teams which the countries have hosted the winter games. In general, the scatter plot reveals that the team thoroughly performed better when at the home field with various degrees, except Yugoslavia, which is hard to tell due to the limited data points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MQ6MxuDPK8rBZRKv" /></figure><p>To quantify the comparative, we group the rank data for each team based on if the game was held at home, and then compute the average rankings for home-field and away-field. The bar plot shows that all top 5 teams performed better at the home field and Japan. It is worth noting that although the German team’s average ranking at home is greater than its away-field ranking, the country only hosted one game in 1928, so such comparison would be less effective. The German team has had an excellent performance in all games since 1998.</p><p>There may exist home field advantage. Admittedly, we have to clarify that the ranking results and athlete performances could be impacted by various factors. Since the home-field data size is much smaller than the away-field data for some teams, a larger data size would be needed to strengthen the argument.</p><h3>3.4 Correlation of Medal Count with GDP or CPI?</h3><p>The medal count could reflect a country’s popularity degree of winter sports as well as national consumption power to some degree. GDP measures the economic activity of a country, which is used to estimate the size of an economy and growth rate. The Consumer Price Index (CPI) measures the average change over time in the prices paid by urban consumers for a market basket of consumer goods and services [5]. So will there be any correlation between medal count and GDP/CPI?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UVKceXT8LULhI_0W" /></figure><p>For most teams, there is a positive correlation between the number of medals they won and the GDP per capita of the country. In particular, it is evident for the following countries: Austria, Canada, France, Italy, United States. However, for Finland and Germany, there is a negative correlation between the number of medals they won and their GDP per capita.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qbJQaUbmSHduSdwJ" /></figure><p>The above scatter plot between CPI and medal count for each country has a much similar linear trendline to the previous GDP and medal count plot. More intuitively, below bar plot shows the correlation coefficients for medal count with such two indicators by county.</p><p>There are five countries that present a very high positive correlation in medal-GDP and medal-CPI with a coefficient higher than 0.75, including the United States, Republic of Korea, Czech Prepubic, Canada, and Australia. For China and Germany, a high correlation can only be observed in medal-CPI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qPwgg4psRg8BA8hY" /></figure><h3>4. Conclusion and Suggestion</h3><p>Following are key findings from this project:</p><ul><li>A total of 23 Winter Olympic Games have been held in 12 countries across three continents until now; 60% of the games were held in Europe. The US is the country that held the most games, four times.</li><li>The numbers of participating athletes and teams, and events grew rapidly over time, particularly after 1980.</li><li>The top 3 disciplines with the most participants are Alpine Skiing, Biathlon, and Cross-Country Skiing.</li><li>Five countries of Austria, Canada, Finland, Norway, Sweden, and the United States attended all 23 times of Winter Olympics.</li><li>The top 3 national teams in the medal ranking table are Norway, the United States, and Germany. They are the strongest countries in winter sports.</li><li>The ranking of Finland, Great Britain, and Sweden witnessed a downward trend over the event.</li><li>Home advantage can be observed in Winter Games. Evidently, there are teams that performed better when the event was held at home, such as Norway, Russia, United States, and Japan.</li><li>Some countries show strong positive correlations between medal count and GDP as well as medal count and CPI, such as the United States, Republic of Korea, Czech Prepubic, Canada, and Australia.</li></ul><p>Future analysis can be performed from the below aspects:</p><ul><li>Analyze the change of Winter Olympic Games record and historical results of the gold winner by the event.</li><li>Analyze the change of historical athlete data relating to health and demographics by event, such as age, height, weight, heart rate, blood pressure, hometown; compare the variables of medal winners with others.</li><li>Based on the historical game data and performance and combined with significant country development indicators, build models to predict the number of participants, medal count, and ranking for teams of interest.</li></ul><h3>Reference and Data Source</h3><ol><li>Kaggle: <a href="https://www.kaggle.com/leminhnguyen/winter-olympics-1924-2018">Winter Olympics (1924–2018)</a>.</li><li>Olympics Official Website: <a href="https://olympics.com/en/olympic-games">Olympic Games</a>.</li><li>World Bank Open Data: <a href="https://data.worldbank.org/indicator/NY.GDP.PCAP.CD">GDP per capita</a>.</li><li>World Bank Open Data: <a href="https://data.worldbank.org/indicator/FP.CPI.TOTL">Consumer price index</a>.</li><li>US Bureau of Labor Statistics: <a href="https://www.bls.gov/cpi/">Consumer Price Index</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b2fe1e511ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to connect Excel to ClickHouse within Kyligence Tiered Storage]]></title>
            <link>https://medium.com/kyligence/how-to-connect-excel-to-clickhouse-within-kyligence-tiered-storage-aed3822febc5?source=rss-be7b6de4a0d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/aed3822febc5</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[kylin]]></category>
            <category><![CDATA[pivot]]></category>
            <category><![CDATA[clickhouse]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Xiaodong (Tony) Zhang]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 07:15:19 GMT</pubDate>
            <atom:updated>2022-01-20T06:30:27.309Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern corporations are increasingly looking for near real-time analytics and insights to make actionable decisions. To help organizations understand more about the benefits of ClickHouse, we will focus on how you can achieve sub-second analysis in Excel with Kyligence Tiered Storage.</p><h3>Why you will be interested</h3><p>This article is based on the benchmark dataset of the retail industry, which contains over 100 MILLION rows in the transaction table, I will operate with dimensions and measures in Excel pivot to compare the query performance among Object Storage, Base Index and Tiered Storage.</p><h3>Why Excel</h3><p>Microsoft Excel is, undoubtedly, the most popular spreadsheet software in the market. Each iteration of this software gives the users a better tool for their statistical needs.<br>PivotTable in Excel is a powerful tool to calculate, summarize, and analyze data that allows you to see comparisons, patterns, and trends in your data.</p><h3>Why ClickHouse</h3><p><a href="https://clickhouse.com/">ClickHouse</a> is an open-source, OLAP (Online Analytical Processing) database originally developed by the company Yandex, for the needs of its Metrica solution (similar to Google Analytics). Yandex is the first search engine used in Russia.<br>ClickHouse was developed with a simple objective: to filter and aggregate as much data as possible and as quickly as possible. Similar to other solutions of the same type (eg. Druid, Pinot), ClickHouse uses a column-oriented model for data storage. It also relies on various parallelization and vectorization mechanisms to take the most advantage of multi-core architectures. Hence, Clickhouse can support data volumes of several petabytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*_nZwXD3Mb_5g4me_.png" /></figure><h3>Let’s start with Kyligence Cloud</h3><p>First, I used <a href="https://kyligence.io/kyligence-cloud/">Kyligence Cloud</a>, if you also like to try Kyligence cloud, you may visit <a href="https://kyligence.io/free-trial/#enterprise">Kyligence</a> to get a free trial. In order to analyze data, it is necessary to import data. I used a 100 million rows dataset which can fully exhibit strong query performance of ClickHouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*WjjaHl7xKGiqocss.png" /></figure><p>The <a href="https://www.cs.umb.edu/~poneil/StarSchemaB.PDF">SSB</a> (Star Schema Benchmark) dataset is designed to measure the performance of database products in support of classical data warehousing applications and is based on the TPC-H benchmark.There are 5 tables in the SSB dataset — table sampling is turned on by default. With sampling I can get statistical information of the entire dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*WTKVCof36YmAGCwz.png" /></figure><p>I ran a sample SQL query to check the row amount of SSB.LINEORDER table. As you can see from the screenshot below, there are over 1 million rows in this table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*3Gp8I0htrKdRDZG8.png" /></figure><h3>Auto-Modeling</h3><p>In Kyligence Cloud, I enabled AI Augmented Mode to build models with SQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*Ai4J7Q0s5m25AH2A.png" /></figure><p>Created a model automatically from SQL command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*46Cz9be7m2tBj1vn.png" /></figure><p>Below is my SQL command which was used for creating the model.</p><pre>SELECT<br>    SSB.LINEORDER.LO_ORDERKEY,<br>    SSB.LINEORDER.LO_LINENUMBER,<br>    SSB.LINEORDER.LO_CUSTKEY,<br>    SSB.LINEORDER.LO_PARTKEY,<br>    SSB.LINEORDER.LO_SUPPKEY,<br>    SSB.LINEORDER.LO_ORDERDATE,<br>    SSB.LINEORDER.LO_ORDERPRIOTITY,<br>    SSB.LINEORDER.LO_SHIPPRIOTITY,<br>    SSB.LINEORDER.LO_TAX,<br>    SSB.LINEORDER.LO_COMMITDATE,<br>    SSB.LINEORDER.LO_SHIPMODE,<br>    SSB.PART.P_PARTKEY,<br>    SSB.PART.P_NAME,<br>    SSB.PART.P_MFGR,<br>    SSB.PART.P_CATEGORY,<br>    SSB.PART.P_BRAND,<br>    SSB.PART.P_COLOR,<br>    SSB.PART.P_TYPE,<br>    SSB.PART.P_SIZE,<br>    SSB.PART.P_CONTAINER,<br>    SSB.SUPPLIER.S_SUPPKEY,<br>    SSB.SUPPLIER.S_NAME,<br>    SSB.SUPPLIER.S_ADDRESS,<br>    SSB.SUPPLIER.S_CITY,<br>    SSB.SUPPLIER.S_NATION,<br>    SSB.SUPPLIER.S_REGION,<br>    SSB.SUPPLIER.S_PHONE,<br>    SSB.CUSTOMER.C_CUSTKEY,<br>    SSB.CUSTOMER.C_NAME,<br>    SSB.CUSTOMER.C_ADDRESS,<br>    SSB.CUSTOMER.C_CITY,<br>    SSB.CUSTOMER.C_NATION,<br>    SSB.CUSTOMER.C_REGION,<br>    SSB.CUSTOMER.C_PHONE,<br>    SSB.CUSTOMER.C_MKTSEGMENT,<br>    SSB.CALENDAR.D_DATEKEY,<br>    SSB.CALENDAR.D_DATE,<br>    SSB.CALENDAR.D_DAYOFWEEK,<br>    SSB.CALENDAR.D_MONTH,<br>    SSB.CALENDAR.D_YEAR,<br>    SSB.CALENDAR.D_YEARMONTHNUM,<br>    SSB.CALENDAR.D_YEARMONTH,<br>    SSB.CALENDAR.D_DAYNUMINWEEK,<br>    SSB.CALENDAR.D_DAYNUMINMONTH,<br>    SSB.CALENDAR.D_DAYNUMINYEAR,<br>    SSB.CALENDAR.D_MONTHNUMINYEAR,<br>    SSB.CALENDAR.D_WEEKNUMINYEAR,<br>    SSB.CALENDAR.D_SELLINGSEASON,<br>    SSB.CALENDAR.D_LASTDAYINWEEKFL,<br>    SSB.CALENDAR.D_LASTDAYINMONTHFL,<br>    SSB.CALENDAR.D_HOLIDAYFL,<br>    SSB.CALENDAR.D_WEEKDAYFL,<br>    SUM(SSB.LINEORDER.LO_REVENUE) AS SUM_REVENUE,<br>    SUM(SSB.LINEORDER.LO_SUPPLYCOST) AS SUM_COST<br>FROM<br>    SSB.LINEORDER<br>    LEFT JOIN SSB.PART ON SSB.LINEORDER.LO_PARTKEY=SSB.PART.P_PARTKEY<br>    LEFT JOIN SSB.CUSTOMER ON SSB.LINEORDER.LO_CUSTKEY=SSB.CUSTOMER.C_CUSTKEY<br>    LEFT JOIN SSB.SUPPLIER ON SSB.LINEORDER.LO_SUPPKEY=SSB.SUPPLIER.S_SUPPKEY<br>    LEFT JOIN SSB.CALENDAR ON SSB.LINEORDER.LO_ORDERDATE=SSB.CALENDAR.D_DATEKEY<br>GROUP BY<br>    SSB.LINEORDER.LO_ORDERKEY,<br>    SSB.LINEORDER.LO_LINENUMBER,<br>    SSB.LINEORDER.LO_CUSTKEY,<br>    SSB.LINEORDER.LO_PARTKEY,<br>    SSB.LINEORDER.LO_SUPPKEY,<br>    SSB.LINEORDER.LO_ORDERDATE,<br>    SSB.LINEORDER.LO_ORDERPRIOTITY,<br>    SSB.LINEORDER.LO_SHIPPRIOTITY,<br>    SSB.LINEORDER.LO_TAX,<br>    SSB.LINEORDER.LO_COMMITDATE,<br>    SSB.LINEORDER.LO_SHIPMODE,<br>    SSB.PART.P_PARTKEY,<br>    SSB.PART.P_NAME,<br>    SSB.PART.P_MFGR,<br>    SSB.PART.P_CATEGORY,<br>    SSB.PART.P_BRAND,<br>    SSB.PART.P_COLOR,<br>    SSB.PART.P_TYPE,<br>    SSB.PART.P_SIZE,<br>    SSB.PART.P_CONTAINER,<br>    SSB.SUPPLIER.S_SUPPKEY,<br>    SSB.SUPPLIER.S_NAME,<br>    SSB.SUPPLIER.S_ADDRESS,<br>    SSB.SUPPLIER.S_CITY,<br>    SSB.SUPPLIER.S_NATION,<br>    SSB.SUPPLIER.S_REGION,<br>    SSB.SUPPLIER.S_PHONE,<br>    SSB.CUSTOMER.C_CUSTKEY,<br>    SSB.CUSTOMER.C_NAME,<br>    SSB.CUSTOMER.C_ADDRESS,<br>    SSB.CUSTOMER.C_CITY,<br>    SSB.CUSTOMER.C_NATION,<br>    SSB.CUSTOMER.C_REGION,<br>    SSB.CUSTOMER.C_PHONE,<br>    SSB.CUSTOMER.C_MKTSEGMENT,<br>    SSB.CALENDAR.D_DATEKEY,<br>    SSB.CALENDAR.D_DATE,<br>    SSB.CALENDAR.D_DAYOFWEEK,<br>    SSB.CALENDAR.D_MONTH,<br>    SSB.CALENDAR.D_YEAR,<br>    SSB.CALENDAR.D_YEARMONTHNUM,<br>    SSB.CALENDAR.D_YEARMONTH,<br>    SSB.CALENDAR.D_DAYNUMINWEEK,<br>    SSB.CALENDAR.D_DAYNUMINMONTH,<br>    SSB.CALENDAR.D_DAYNUMINYEAR,<br>    SSB.CALENDAR.D_MONTHNUMINYEAR,<br>    SSB.CALENDAR.D_WEEKNUMINYEAR,<br>    SSB.CALENDAR.D_SELLINGSEASON,<br>    SSB.CALENDAR.D_LASTDAYINWEEKFL,<br>    SSB.CALENDAR.D_LASTDAYINMONTHFL,<br>    SSB.CALENDAR.D_HOLIDAYFL,<br>    SSB.CALENDAR.D_WEEKDAYFL<br>;</pre><p>Before saving the current model, cancel the option of Add Base Indexes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*K3le4YXQahIZ_rqD.png" /></figure><p>Finally we have a start schema model for data analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*MaxeCKDAzPNQsfiR.png" /></figure><h3>MDX</h3><p>After building the model, let’s explore MDX in Kyligence Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*3A3_HDPlTrm1x4mk.png" /></figure><p>I need to set a name for MDX dataset. Here, the dataset was Kyligence Cloud model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*XscWpXdB0FW5SgFM.png" /></figure><p>You could even define more complicated relationships among MDX datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*wGTGbr69aHG-AmAE.png" /></figure><p>When defining Semantics, you can define more objects, like Dimension, Measure, Hierarchy, Calculated Measure, etc. These semantics will be synchronized to uplevel BI tools. In Tableau, PowerBI or Excel, end users can drag &amp; drop MDX objects to analyze the data. Let’s create a Profit measure as an example, which equals subtracting cost from revenue. <em>profit = revenue — cost.</em></p><h3>Connect Excel with MDX</h3><p>Opened Microsoft Excel from Windows 11 , or other version of Windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*7ZxLkBWcTx2JLHXT.png" /></figure><p>Click Data &gt; Get Data &gt; From Database &gt; From Analysis Services. Note: this service only works in Windows. In MacOS, Analysis Services is not yet compatible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*4zXTEoFp66KHSyhh.png" /></figure><p>Kyligence Cloud provides enough clear connection information, which helped me set up a connection between Excel and MDX.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*MKX5tIFFYYwTqLc9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*5mf60fygtxwPrVVr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*x5sqSfkUX3qSAk38.png" /></figure><h3>Create Excel pivot table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*s6W1YejKFycf3Bhe.png" /></figure><h3>Query Performance</h3><p>First, add “YEAR” “CATEGORY” in Rows, “Revenue” in Values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*O4yHrgESJ_EPlzsK.png" /></figure><p>It took 17s to get all the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*eRSM8Nito4zgkB_5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*86qb_GIju23jZDYp.png" /></figure><p>From Query History, the MDX query had been parsed into different parts of SQL queries. The queries were answered by OBJECT STORAGE, which means they got push down to the original dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*IGb4SI0OMwZtUX6H.png" /></figure><p>Second, add “YEAR” “CATEGORY” in Rows, “Supplycost” in Values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bA7UMvMT4sX97KBx.png" /></figure><p>It took 11s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*M6gcZrYhe8Uc257R.png" /></figure><p>Third, add “YEAR” “CATEGORY” “REGION””NATION” in Rows, “Profit” in Values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*HOwweGnfz0h8Bm4D.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*-FeuZ1eOucZQGIau.png" /></figure><h3>Base Index</h3><p>If there is no base index or when a base index is missing, click <strong>+ Index</strong> to add the base indexes in the drop-down box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*gk_DE-ocOtfzBdO1.png" /></figure><p>We often treat base index as safety index because it includes all dimensions and measures. Base index can answer the ad hoc queries on the fly, then avoid queries pushing down to object storage. To benefit from the base index, you should build your segments based on the base index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*N1UE-m811eof4KPs.png" /></figure><p>After finishing building the base index, I found queries could be answered by model instead of object storage. Hence, base indexes can avoid queries pushed downto original datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*NE7EkVPH_pNyCZZF.png" /></figure><p>Here I’m listing the query performance of base table index, with 3 of the same queries in Excel as before.</p><h3>Improve Query Performance with ClickHouse</h3><p>Kyligence Cloud 4.5 provides our users with the ClickHouse option. To benefit from ClickHouse, user has to add another node named Tiered Storage Node when installing Wordspace in their clouds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/0*KAAP_3YrU_fqZHT3.png" /></figure><p>Also, Tiered Storage needs to be turned on in the “Setting” page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*DH6yeSwrXcqJAwEI.png" /></figure><p>Chose the base table index, then “Load to the Tiered Storage”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*RRGIvJDTCTQZ0RfV.png" /></figure><p>It will take some time to load data to ClickHouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*6QEfFcjWzTwezsqn.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*VE20QcmViXCVQ0vy.png" /></figure><p>After the data was loaded into ClickHouse, I ran the same 3 queries in Excel pivot as before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*eWHbCxny0P-NEdjd.png" /></figure><p>Then, I compared these three engines: “Query Pushdown,” “Base table index” and “Tiered Storage with ClickHouse.” The performance of Tiered Storage with the same queries was really impressive. I tried some other combinations of dimensions and measures, and the performance of ClickHouse was relatively fast even in self-service analysis or ad-hoc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*98T1IV58Afapi84K.png" /></figure><h3>Kyligence Tiered Storage</h3><p>Powered by the technology of ClickHouse,<a href="https://bit.ly/3d4cToy"> Kyligence Cloud 4.5</a> offers our users the advanced feature of Tiered Storage, which can help users quickly and cold start to query without pre-computation, and can significantly improve the performance of ultra-multi-dimensional flexible analysis and detailed query analysis. At the same time, the two-level storage design based on HDFS/object storage and ClickHouse can fully cover various analysis scenarios, bringing users more possibilities for analysis and exploration based on massive data.</p><p>Tiered storage not only supports flexible ad-hoc query scenarios, such as tagging analysis or user behavior analysis, which will bring greater assistance to the enterprise’s refined operation and auxiliary business decision-making; it also can be used with the Kyligence unified model to manage data so as to seamlessly connect with mainstream business BI tools and Excel capabilities to empower business analysts to analyze.</p><p>After enabling tiered storage, users do not need to worry about how data is distributed and how to import, they only need to focus on modeling according to business needs. This can greatly reduce the cost of modeling and model optimization. Tiered Storage can make business more agile in the future.</p><p>The following figure shows the architecture of tiered storage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*78dp_zMauSardNXS.jpg" /></figure><p>If you would like to get a Free Trial of Kyligence, please refer to <a href="https://kyligence.io/blog/how-to-connect-excel-to-clickhouse-within-kyligence-tiered-storage/">link</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aed3822febc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kyligence/how-to-connect-excel-to-clickhouse-within-kyligence-tiered-storage-aed3822febc5">How to connect Excel to ClickHouse within Kyligence Tiered Storage</a> was originally published in <a href="https://medium.com/kyligence">Kyligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>