<?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 Fredrik Gabrielsen on Medium]]></title>
        <description><![CDATA[Stories by Fredrik Gabrielsen on Medium]]></description>
        <link>https://medium.com/@gabrielsenfredrik?source=rss-a4a0ca4d9679------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*9Ms1dhGHOEke5fP9ZgTjsQ.png</url>
            <title>Stories by Fredrik Gabrielsen on Medium</title>
            <link>https://medium.com/@gabrielsenfredrik?source=rss-a4a0ca4d9679------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:19:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gabrielsenfredrik/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[How we scaled analytics @ GodtlevertGruppen/LMK group]]></title>
            <link>https://medium.com/godtlevert/how-we-scaled-analytics-godtlevertgruppen-lmk-group-cd4babc78dd8?source=rss-a4a0ca4d9679------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd4babc78dd8</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[godtlevert]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Fredrik Gabrielsen]]></dc:creator>
            <pubDate>Tue, 21 Jan 2020 11:34:09 GMT</pubDate>
            <atom:updated>2021-04-08T08:11:20.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>How we scaled analytics @ LMK Group</h3><p>It is interesting to look back three years when the in-house tech department was formed and we decided to move reporting out of manually updated Excel workbooks and start the journey towards data science and machine learning.</p><p>Back then we read this really good article from Tristan Handy called «<a href="https://thinkgrowth.org/the-startup-founders-guide-to-analytics-1d2176f20ac1">The Startup Founder’s Guide to Analytics</a>» which featured a pyramid of different analytics capabilities required in the different organizational stages and we decided it would be our guiding star when treading into the world of data and analytics. 3 years and 2 organizational merges later, each doubling our employee headcount, we are sitting comfortably in the «growth stage» at the top of the pyramid with an analytics stack featuring integrated machine learning processes and a data lake being fed by multiple data flows.</p><p><strong>This is the story of how we got there.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNn-6ehUAY2T9YOCSL7Uiw.png" /><figcaption>The pyramid we used for strategic planning. Image fetched from Tristan Handy’s original post: <a href="https://thinkgrowth.org/the-startup-founders-guide-to-analytics-1d2176f20ac1">https://thinkgrowth.org/the-startup-founders-guide-to-analytics-1d2176f20ac1</a></figcaption></figure><h3>Phase 1 — Starting with SQL-based analytics</h3><p>The story starts with Godtlevert. Like most other small companies we relied upon Excel to do all our analytical work (which at this stage was very little). We would have huge pivot tables that regularly crashed the computers if the calculation was too heavy or the dataset too large. At this stage, most of the analysis and «dashboards» were built on top of two single flat datasets: orders and customers.</p><p>This solution had several shortcomings, but the ones that caused the most problems were:</p><ul><li>no centralized place for definitions</li><li>everyone was looking at their own version of the dataset (when did they last update it)</li><li>no data governance</li><li>requires lots of maintenance</li></ul><p><strong>We knew we had to act quickly to avoid people losing faith in data.</strong></p><p>After reading up and discussing internally we had a pretty good idea of what the next few steps would be, as well as the article described above for more long-term planning of how we eventually would reach the machine learning stage. The first big win would be to use a dashboard service/tool to solve our pressing business intelligence needs.</p><p>We decided we wanted something simple to set up and maintain since we did not want to spend the time and resources to maintain a solution ourselves. This led us to <a href="http://modeanalytics.com/">Mode Analytics</a>, an excellent tool that allowed us to write SQL queries and make graphs and dashboards on top with filters, automated emails and everything we needed. With this new way of creating data directly on top of the database, we solved the following challenges we had:</p><ul><li>a partly centralized place for definitions through database views</li><li>everyone was looking at the last run of the report with the same data</li><li>data governance became a lot easier since the Analytics team created and updated all the graphs and dashboards</li><li>really simple to set up for new employees and use since it is just in the browser</li><li>everything is controlled either in the database or on the Mode Analytics webpage, making maintenance a lot easier</li></ul><p>This served us well for about a year until we merged with our largest competitor in Norway, <a href="https://adamsmatkasse.no/">Adams Matkasse</a>, bringing them onto our platform and increasing our headcount and users to 100 employees and increasing our analytics team from 1 to 3, which leads us to …</p><h3>Phase 2 — Getting a dedicated data warehouse</h3><p>With the employee headcount doubling, the reporting needs seemed to quadruple. Extracting marketing lists directly from SQL and creating curated dashboards for all the employees with an interest in data was both time-consuming and we started to notice the impact of having employees updating dashboards with analytical queries directly on our production databases. Combining data from different databases were also something we lacked. To address these challenges we decided we had to the following:</p><ul><li>create a separate analytical environment</li><li>create some sort of tool that marketing and sales could use to get their lists without using resources from the Analytics team</li></ul><p>The main objective of the analytical environment was to separate the load and the code from the production databases, allow us to combine data from all the production databases and give us SQL access to marketing and web usage data. We also wanted to go fully Software-As-A-Service for the analytics environment, making it both easier to set up and maintain, and more flexible so we can swap out marketing tools without having to build new ETL pipelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVQuEvuctUkZNWdcGq9kwQ.png" /><figcaption>An overview of the first analytics architecture (end of phase 2)</figcaption></figure><p>We decided on <a href="https://aws.amazon.com/redshift/">AWS Redshift</a> for our data warehouse. It seemed like a safe choice since they were so widely used. Another benefit of using Redshift in our data strategy was how many tools and services that had built integrations with Redshift. It seemed like every single one of the tools that provided some kind of pipeline to a data warehouse all supported Redshift.</p><p><strong>Data lake approach</strong></p><p>Creating and updating the views directly in the data warehouse gave us some issues, primarily that we had no version control or backup if we were to accidentally delete something. To solve this we decided to use a tool called “<a href="https://www.getdbt.com/">dbt</a>” (data build tool) from Fishtown Analytics. That way we could create the views as SQL-scripts that reference each other, but instead of doing the scripts directly on the database, we ran builds inside dbt that committed to git at the same time as the script was running, making sure that all changes to the views had logs and version control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ytYIc53C421avKG4kosig.png" /><figcaption>Image fetched from getdbt.com, dbt is the area above the data warehouse</figcaption></figure><p>For gathering web usage data we decided to go for <a href="https://segment.com/unified-customer-data/">Segment</a>. Segment allows us to define events once, then send them to Mixpanel, Google Analytics, Intercom, and our Redshift data warehouse through their integrations. It also functions as a data pipelining tool directly, allowing us to connect to our marketing tools and fetch the data just by adding an API-key then pipe that into our data warehouse. Creating a new data pipeline from a new marketing tool we want to try out and send it to our data warehouse doesn’t have to take more than 5 minutes.</p><p>Instead of doing the typical ETL (Extract, Transform, Load) we like to do ELT (Extract, Load, Transform). This way we have a large pool of data available at all times without having to modify pipelines or jobs when we wanted to do changes. To achieve this, we used <a href="https://www.stitchdata.com/">Stitch</a> for the data pipelines from the core databases. Creating pipelines with Stitch was incredibly easy, as we only had to create two database users, one in each database with the right permissions, before pressing «check» on the tables we wanted to send over. Stitch could not track actual changes in the database and rely instead on primary keys and timestamps to say if a row had to be updated or not. If we added a new column to a table, <a href="https://www.stitchdata.com/">Stitch</a> would know and simply add it in the next run, and since we specified the column names in the views we really didn’t notice or give the new field any attention until we needed it.</p><p>Even though Mode Analytics worked great for most dashboards and reports, we noticed its limitations in some regards, like its limited graph and report elements. For this reason, we decided to use <a href="https://www.tableau.com/">Tableau</a> on the side for the heavier reports that require more customization. This combination of a light and quick reporting tool where reports could be created in minutes and a heavier tool where “everything” is possible worked great for us. The only drawback is that the end-users would have to search for reports in both tools, but the advantages of having the flexibility and speed outweighed this.</p><p>A cool feature of Mode Analytics is that they support python notebooks directly in the reports with the most popular packages. We could create one or more SQL-queries to get the datasets, then instead of (or in addition to) adding graphs and report elements on top of them, we could also open the notebook tab and reference the data as pandas dataframes. Then when we had a visualization we wanted to show in the report, we could very simply add it to the report itself together with the regular elements directly on the SQL-queries. Whenever someone pressed “run” the SQL-queries would fetch the data, then the python code would run in the background and at last, the dashboard would appear with fresh data.</p><p>At this time we were 3 people on the analytics-team and through Mode Analytics notebooks we began doing some ad-hoc segmentation and analysis of the customers.</p><h3>Phase 3 — Advanced models and machine learning</h3><p>One year later we had another merger, this time with the largest mealkit-provider in Sweden, <a href="https://linasmatkasse.se/">Linas Matkasse</a>, making the combined group the leading mealkit-provider in the whole Nordics.</p><p>We were now about 200 employees split between the two countries. At first, we continued like before, just adding a “country” filter to all reports to be able to separate the numbers, however, we quickly realized that we had to do some changes to be able to support the new organization and its needs.</p><p>After some discussions internally in the Tech-department and with the management team of both countries we agreed on a data strategy going forward:</p><ul><li>move the data warehouse and the main pipeline tool to Azure</li><li>increase data knowledge and interest in all departments</li><li>make the data even more accessible to marketing and sales</li><li>transfer responsibility for the data catalog to the technical product owner</li><li>creating a forecasting model and getting some experience with machine learning in production</li></ul><p>I’ll explain briefly how we approached each of them.</p><h4>Moving to Azure</h4><p>Moving to Azure gave us a lot of advantages, mainly:</p><ul><li>same database type as the production databases, allowing us to use the same functions and syntax</li><li>same hosting provider as the production system, meaning that SLA, billing and support, both in the form of Microsofts technical architects and people internally with knowledge of the system was more available</li></ul><p>Since we went with a data lake approach where we loaded most of the data we could get our hands on into the data warehouse, we decided to go for a regular SQL Server database instead of Azure SQL Data Warehouse or Azure Data Lake. 99% of the data we are interested in using is structured, so the cost in terms of functionality and flexibility associated with changing to a data lake that supports unstructured data was not worth it for us. We don’t do too much ad-hoc analysis on top of large datasets so for most of our day to day use, a regular SQL Server database will handle it better than a data warehouse with fact tables and dimensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ifcg0Jo0JZWXmrZrXrSEYQ.png" /><figcaption>The current analytics architecture</figcaption></figure><h4>Become data-driven</h4><p>Perhaps the main objective of the new data strategy was to increase the data knowledge and interest in the other departments. People were using data and reports that were already built, but since the members of the analytics team were the only ones who could modify them or create new reports, many of the smaller questions were never asked.</p><p>To make it easier for the other departments to find answers to more of their questions without having to order a new report from Analytics, we had to find a tool that could do the following:</p><ul><li>both a way to write SQL for creating custom datasets and a click &amp; drag type of interface for asking questions on top of some pre-defined datasets</li><li>scheduled runs with email or slack notifications</li><li>a data catalog (so people could look up what the different datasets and columns were)</li></ul><p>After testing out a few different tools we decided on <a href="https://www.metabase.com/">Metabase</a>. It is open-source and supports all of our requirements.</p><p>With the tool set up, we started creating the most default datasets that would answer most of the questions people were asking as views in the data warehouse. We then added documentation and descriptions of the different fields and made them available in Metabase. The result is that employees from all departments now have pre-defined and curated datasets available that they can filter, aggregate and then save as a public or personal dashboard without any SQL or technical knowledge.</p><p>By this point, we had used Activecampaign for our marketing automation and Intercom for our chat and customer support tool for about 2 years and we were pretty confident we would continue with them in the foreseeable future. Up to this point, the sales and marketing teams had exported lists from Mode Analytics and then imported them with the fresh data into the systems, but manual CSV-imports always have a risk of incorrectly mapped fields. To mitigate this, we decided to build a customer sync module.</p><p>The customer sync module is built in Python and runs on top of our data warehouse. It is triggered by our company-wide scheduler service and compares the last synced data with current data to identify the customers we need to update. It then proceeds to add the customers a queue before starting the API-calls to update them. The result is that the marketing and customer support team now has all the fields they use for segmentation and personalization available and up-to-date directly in the tools they use so they can filter and create powerful automation.</p><h4>Transfer ownership of the data catalogs</h4><p>With the datasets easily available to the departments, we started noticing a gap between what the analyst responsible for the datasets and reports, and the technical product owner responsible for the whole module, workflows and production data model were working on. Examples of this could be new datasets on top of legacy tables that were not used, and fields and tables that were deprecated without the analyst being aware, resulting in bad datasets.</p><p>To handle this gap between the product owner and the analyst better we transferred the ownership of the data catalog for each module/department to the product owner. That way analytics-related things are discussed and prioritized together with the more traditional development tasks and the same person that decides changes in the module, now also controls the data products created on it.</p><h4>Creating a forecasting model</h4><p>We have an ongoing project to digitalize our processes through machine learning and statistical models. Currently, we are working on creating a forecasting model. Now that we are gradually reducing the time between order and the delivery, even more, we sometimes have to order from our suppliers before we know the final number of meal kits that were sold so getting a stable and digital forecast is key.</p><p>After testing out some different options we decided on <a href="https://facebook.github.io/prophet/">Facebook’s Prophet model</a>. Since our business is very season- and holiday-dependant, Prophet&#39;s ability to take the moveable holidays and actually move them to match the new year’s holiday plan was gold for us.</p><p>We also have a long-term goal of creating a near-real-time recommendation engine that uses the dishes you have chosen in the past and its data (ingredients, tags, difficulty, etc) to create a personalized mealbox alternative we can offer to our customers next to our tailored mealboxes. So the stack we built for machine learning and advanced models had to be prepared and able to support that in the future as well.</p><p>Now, some months later we have a completed stack with the model hosted and run on <a href="https://azure.microsoft.com/en-us/free/services/databricks">Azure Databricks</a>, while we have APIs to trigger and get the results, as well as a separate “analytics int-layer” database to make sure the data load from heavy queries and reports didn&#39;t impact the API speed. We’ll write another article covering this in more detail later on.</p><p>Meanwhile, you can read more about how we went about creating and testing the model in this article written by Anders, one of our data scientists: <a href="https://medium.com/godtlevert/experiment-driven-data-science-test-process-for-forecasting-a09ed3e57717">https://medium.com/godtlevert/experiment-driven-data-science-test-process-for-forecasting-a09ed3e57717</a></p><p>I hope you found this interesting and maybe even helpful if you are on a related path. If you are on a similar journey we would love to get in touch with you and share experiences. Reach out to <a href="https://www.linkedin.com/in/fredrik-gabrielsen-395a6279/">me</a>, <a href="https://www.linkedin.com/in/anders-westrheim-a20231151/">Anders</a> or our <a href="https://www.linkedin.com/in/alexander-aagreen-063a5745/">CTO</a> on LinkedIn if you are interested.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4babc78dd8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/godtlevert/how-we-scaled-analytics-godtlevertgruppen-lmk-group-cd4babc78dd8">How we scaled analytics @ GodtlevertGruppen/LMK group</a> was originally published in <a href="https://medium.com/godtlevert">Cheffelo  — Tech &amp; Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>