<?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 Sami Yabroudi on Medium]]></title>
        <description><![CDATA[Stories by Sami Yabroudi on Medium]]></description>
        <link>https://medium.com/@samiyabroudi?source=rss-f73756d4c3d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pitDKuFmuY85sv3u.jpg</url>
            <title>Stories by Sami Yabroudi on Medium</title>
            <link>https://medium.com/@samiyabroudi?source=rss-f73756d4c3d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:52:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samiyabroudi/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[Data Architecture for Acquisition-heavy Businesses]]></title>
            <link>https://blog.flatirondata.ai/data-architecture-concepts-for-acquisition-heavy-businesses-242ab2467622?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/242ab2467622</guid>
            <category><![CDATA[analytics-engineering]]></category>
            <category><![CDATA[private-equity]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Sat, 16 May 2026 19:36:10 GMT</pubDate>
            <atom:updated>2026-05-19T16:42:17.135Z</atom:updated>
            <content:encoded><![CDATA[<p><em>These were developed for rollup companies that acquire same-category SMEs with different software systems and record keeping practices. They compliment our core modeling practices </em><a href="https://blog.flatirondata.ai/flatirons-more-modular-star-schema-05436c8cc990"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ivqFAcSMMN7Eb1f8.png" /></figure><p>Acquisition-based businesses come with their own set of complications when building unified reporting. Even if the subsidiaries think about their business in exactly the same way and are principled record-keepers — both often unlikely — their record keeping practices and core systems are likely to diverge from each other significantly.</p><p>A data model that is not planned out deliberately will result in:</p><ol><li>Spaghetti code that becomes increasingly difficult to onboard onto or debug or even monitor</li><li>Increasingly long and bumpy acquisition integration periods</li><li>Increasingly long times to develop any additional analysis, reporting, or other data products</li><li>Increasingly long and bumpy implementation of any conceptual changes</li><li>Difficulty in connecting disparate datasets (ex: revenue &lt;&gt; sales/marketing) for cross-functional analysis</li></ol><h3>Basic Idea 1: Develop A Unified Entity Set That All Subsidiary Data Feeds Into</h3><p>Design entities and properties (i.e. fact and dimension tables) in a way that reflects the core concepts of the business and will accommodate current and future subsidiary systems and practices. Standardize concepts like customer and service, and think through their properties carefully — this can turn out to be time-consuming in the beginning, but the effort will pay off in spades later on.</p><p>Don’t overfit to current subsidiaries, and anticipate differences with future subsidiaries. A really basic example is an invoice: even though invoices for current subsidiaries may only have one line item per invoice, that is likely to change in the future so just build in the idea from now (fact_invoice_line_item, factgroup_invoice).</p><h4>Feeds</h4><p>We want every subsidiary’s data to feed into the canonical entities. We standardize this concept into <em>feed_&lt;table_name&gt;_&lt;source&gt;</em> tables. So we might have:</p><ul><li><em>feed_factgroup_invoice_subidiary1</em></li><li><em>feed_factgroup_invoice_subsidiary2</em></li><li><em>feed_factgroup_invoice_subsidiary3</em></li></ul><p>These all have exactly the same final columns and get unioned into the final <em>factgroup_invoice</em> table.</p><p>Note that an AI coding tool like Cursor can vastly speed up batch editing of feed table queries. It will be even more effective if pre-loaded with Cursor Rules that describe your design principles.</p><p>Recall that Flatiron <a href="https://blog.flatirondata.ai/flatirons-more-modular-star-schema-05436c8cc990">frowns on</a> the idea of staging tables, which are too ambiguous and unstructured.</p><h4>Ensure Unique IDs</h4><p>In the example of invoice_id, we can imagine two different invoices from different sources accidentally having the same id. An easy solution is usually having new id be <em>unique_source_name || ‘-’ || id_from_source. </em>And, of course, add uniqueness tests everywhere just in case.</p><h4>Analysis/Aggregation Logic Should Only Be Downstream from the Entity Tables</h4><p>It’s surprising how often we see situations where even simple calculations like revenue and discounts are done separately for different subsidiaries and then slapped together into the final report. At scale this paradigm makes monitoring, verifying, tracing, and modifying extremely challenging for no reason.</p><p>Rather, all data must flow first into the canonical entity tables and then aggregations and analysis are performed using only those tables. A single calculation works exactly the same for either all of the sources or for none. Any issue affecting only one source is then most likely because the source’s feeds are corrupted, and diagnosing is a simple exercise.</p><h4>Give Operations and Subsidiary Teams Easy Debug Tools</h4><p>By providing these teams with ergonomic access to row-level data, they can monitor and debug any issues on their own.</p><h3>Basic Idea 2: Mapping</h3><p>Mapping sometimes requires meaningful upfront headscratching and manual annotation. It is usually optimal to have the final list of map-to values be a short as possible, as this will speed up future analysis and reduce mistakes/misses during analysis. Make use of properties — or, occasionally, new entities — to encapsulate variation and shrink the final list to the utmost extent possible.</p><p>Mapping tables are named <em>mapping_&lt;table_being_mapped&gt;_&lt;concept_being_mapped&gt;</em></p><h4>Example: Services Offered</h4><p>It is continuously surprising to us how different service lists can look between different acquisitions, even when they are using the same management software and providing equivalent services. Common variations include naming, how recurring subscriptions are handled, and bundling.</p><p>Consider this contrived example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVV2riPgSeTUl-NxUFsBgw.png" /></figure><p>The minimum list of services in this case is the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHE1UpDd2naNH2YwQ7Cc4w.png" /></figure><p>Mapping tables will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*79QTVieRQ3gBpa49Kpijgw.png" /></figure><p>It is recommended that separate mapping tables are created for each subsidiary. As complexity grows it becomes untenable to encapsulate all variations in source data columns within a single mapping table.</p><h4>Mapping Tables, Not Query Logic, Wherever Possible</h4><p>Mapping tables are much easier for operations teams to understand, comment on, and edit themselves.</p><h4>Ensure IDs and Slugs Stay Fixed</h4><p>Some mappings and dim tables may be generated by a script or query. In this case it’s essential that reruns of the script are additive only. In our services example above, we would not want the unified_id’s in dim_service to move around, for example, or the service name in dim_service to change slightly toward a different subsidiary’s naming conventions.</p><p>The methods for keeping existing entries fixed are numerous and case dependent.</p><h4>Bundling</h4><p>If this example had included service bundling (ex: “huffing and puffing monthly”), we would have started by asking the subsidiary if it’s straightforward to split bundled-service invoices into multiple line items at the feed_fact_invoice_line_item step. If that is not the case, then we would either (a) add a bundled service to dim_service or (b) created a new entity called a service_bundle.</p><h4>Differentiate Between “source_” and “unified_” on Column Names</h4><p>Make mapping tables as clear as possible by denoting which columns are inputs and which are outputs.</p><h4>Ensure No Silent Failures or Fanouts</h4><p>Max out automated tests and other methods of ensuring that mapping is 1:1 and that data isn’t accidentally being dropped or doubled.</p><h4>Again, Help Ops Teams Help Themselves</h4><p>Provide operations and subsidiary teams with ergonomic ways to see how their data is being mapped and how that feeds into their metrics. They can suggest adjustments or fixes and will feel more in control of their destiny.</p><h3>Tricks for Correcting Disjointed Data Feeds</h3><p>Consider the common case where invoices from a subsidiary for a single customer over several years are not easily connected to each other. The subsidiary may have had poor software that doesn’t formalize the concept of a customer, no SOP for proper recording of customers on invoices, or no enforcement of said SOP. Challenges like this are common.</p><p>There’s no single cure-all, but we can recommend the following two tricks:</p><ol><li>Snowflake and BigQuery now have really strong support for advanced string functions.</li><li>Anthropic’s Claude can write some really great python scripts now for fully encapsulated problems like this. Just make sure you’re still the one guiding the result.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=242ab2467622" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/data-architecture-concepts-for-acquisition-heavy-businesses-242ab2467622">Data Architecture for Acquisition-heavy Businesses</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tariffs and Inflation: Use AI to Assess Competitor Pricing and Supply Chain Daily]]></title>
            <link>https://blog.flatirondata.ai/tariffs-and-inflation-use-ai-to-assess-competitor-pricing-and-supply-chain-daily-05a4c36d32e5?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/05a4c36d32e5</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[tariffs]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[b2b]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 00:07:33 GMT</pubDate>
            <atom:updated>2025-04-25T00:09:41.229Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Change can mean opportunity. A key component of seizing opportunity is having strong/superior information.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sc70BB_46nNOAA_jykuWSQ.png" /><figcaption>Compare your product catalog to theirs</figcaption></figure><p><em>Web scraping is not new, but LLM AI provides another tool for automated product matching when SKU matching isn’t enough.</em></p><p><em>The biggest gotcha with web scraping is to prevent your traffic from getting flagged as suspicious by the scraped site — there are many ways to manage this, as discussed in concluding sections.</em></p><h3>Goal: Stay On Top of Competitor Changes</h3><p>It’s possible that your industry may be shifting quickly enough that your relative position is changing without your realizing it. We want to know about these as early as possible, while they’re still in their infancy.</p><p>Information we’re typically looking to keep track of:</p><ol><li>Competitor pricing shifts and volatility (applies to both services or SKUs)</li><li>Competitor pricing strategy (ex: surgical vs broad price increases)</li><li>Shifts supply chain for a SKU</li><li>Non-identical substitutions</li><li>New offerings or pivots</li></ol><h3>Get Your Feet Wet: Track a “Representative Cart”</h3><p>A strategically formulated cart can be put together on any shopping site, and the changes to those cart items can be tracked more easily than a full-fledged catalog scraping (similar to economists’ tracking of staple grocery baskets).</p><p>Initially this can all be done manually — an actual person builds the cart and puts the prices into a spreadsheet. Then automate regeneration of the cart when the cart is cleared (many sites do this after a certain number of days). Then automate scraping of the prices of the cart items. Then automate tracking of other information about the cart items (ex: manufacturer or source country).</p><h3>Quick Payback Time: SKU Matching and Competitor Offerings Characterization</h3><p>If you have an ecommerce site that uses manufacturer model numbers shared with other sites, then your next step in building out automated competitor intelligence gathering is direct comparisons of identical SKUs. This is simple to build, almost mechanical.</p><p>After that, another quick payout relative to upfront cost is usually obtained by characterizing the competitor offerings catalogs and detecting changes in them <em>without</em> trying to match to items in your own store or additional competitor sites. For example, it may be helpful to know that the number of SKUs your competitor is offering in the category of ball bearings has stayed roughly the same, but the number of SKU deletions/additions within the category has lately been much higher than usual. You can also track pricing changes over time, and also see that the sourcing mix has changed from 80% from China to 55% from China.</p><p>Thoughtfully generated reports — both at a line item and aggregate level — can be quickly skimmed by a knowledgeable human for notable changes, and further manual investigation can be done in a highly targeted manner. This should yield a credible core understanding of sourcing changes, pricing changes, and offering changes.</p><h3>The Whole 9 Yards: Itemized Cross-Catalog Comparisons</h3><h4>With Structured Data</h4><p>As one can imagine, cross-catalog comparison can be easier or tougher depending on the state of the two catalogs. More structure obviously makes things much easier. Use language similarity tools to match both top level categories and descriptors.</p><p>Within your own catalog, customer search terms and browsing journeys can be used to expand the descriptors of an item. In most cases it’s best to use “hacky” methods first, manually review, and see how far you have left to go.</p><h4>With Less Structured Data</h4><p>LLMs, grammar parsers, and some nifty NLP tricks can often help you pull out a reasonable taxonomy for an item if you only have blobs of text to work from. Search history before purchasing is also massively helpful. Relying on brute force tools alone is unlikely to finish the job, though — there’s always room for context-specific human cleverness.</p><h3>Tips for Not Getting Blocked by Competitor Sites</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*zWGksQuI0IdY8Y8-Yidv9A.png" /></figure><p>Commerce sites beyond a basic level of sophistication will usually have monitors alerting for suspicious or bot traffic, especially if the site does not intend to sell via third party listings (ex: Google Shopping). The approach one takes to avoiding getting blocked is case dependent, but there are a few themes:</p><ul><li>mimic human behavior as much as possible, firstly by inserting random-length, human-replicating pauses in between actions; consider also the time of day (business hours is better for b2b, for example)</li><li>consider splitting up the scraping across numerous logins, ip’s, etc.</li><li>consider ip masking/rotation services</li><li>have a fallback plan</li></ul><p>A fallback plan might be as simple as the “representative cart” method above.</p><h3>Bonus Points: Assess At-Checkout Fees/Discounts</h3><p>Couple an automation tool like Selenium with simple comprehension bots to monitor anything unusual happening at checkout, such as new fees or discounts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05a4c36d32e5" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/tariffs-and-inflation-use-ai-to-assess-competitor-pricing-and-supply-chain-daily-05a4c36d32e5">Tariffs and Inflation: Use AI to Assess Competitor Pricing and Supply Chain Daily</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tariffs and Inflation: Get Early Signals of Shifting Customer Behavior]]></title>
            <link>https://blog.flatirondata.ai/tariffs-and-inflation-get-early-signals-of-shifting-customer-behavior-69b6660aa334?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b6660aa334</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[b2b]]></category>
            <category><![CDATA[inflation]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 23:28:48 GMT</pubDate>
            <atom:updated>2025-04-25T00:09:08.358Z</atom:updated>
            <content:encoded><![CDATA[<p><em>At some point, shifts in your customers’ behavior become glaringly obvious. Be aware of these shifts well before then and address the shifts proactively, not reactively. Intervene before your competition does.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_VRsr2oqDW3QLDvI.jpg" /></figure><h3>High Level: Where are We Looking?</h3><p>If you’re an e-commerce company with frequent reorders, you’ll want to focus on:</p><ul><li>Cart size and checkout frequency</li><li>Sku quantity and stock levels</li><li>Product mix, including cost-effective substitutes</li><li>Browsing behavior, other feature use changes</li><li>Usage of additional levers like shipping method, coupons, etc</li></ul><h3>First: Map Product Substitions</h3><p>If your product catalog is not highly structured, please refer to methods from our post <a href="https://medium.com/flatiron-data-ai/tariffs-and-inflation-use-ai-to-assess-competitor-pricing-and-supply-chain-daily-05a4c36d32e5">Use AI to Assess Competitors and Supply Chain Daily</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyI-XWF2VabJrVarDUko6g.png" /></figure><p>Even when data is extremely structured, it is still helpful to develop a <em>substitution map</em>, as correctly identifying substitutions may require a bit more flexibility than only using item categorizations. For example, consider disposable foot warmers, woolen socks, and electric socks; meaningful price changes to one may cause a utility company to switch to one of the others for their linemen, though they may each be catalogued under a separate product category.</p><p>The fastest way to kick off a substitution map is to run crude analyses and then have knowledgeable humans verify the output and suggest methodology improvements. At the customer level, for example: (1) identify SKUs that are being ordered in lesser quantities and SKUs that are being ordered in higher quantities (2) match them using similarity scoring methods, and (3) have humans review the matchings and also suggest improvements to approach.</p><p>The next step for enhancing a substitution map is incorporating search and browsing data — let your shoppers tell you which products are related based on which they evaluate against each other.</p><h3>Iterate on Purchasing Change Analysis</h3><h4>Start with Simple Averages</h4><p>In some cases you may be able to detect clear shifts in purchasing patterns by simply looking at cart sku count, quantity per sku, order frequency, and other straightforward calculations. It may be helpful to initially focus on the most critical sku’s and analyze them manually from all angles.</p><p>If these simple methods are yielding clear signals, it’s likely that behavior changes are already in advanced stages and that there is a lot of opportunity to intervene earlier with customers as additional analyses are incorporated</p><h4>To Better Describe Quantity and Frequency Changes, Apply Operations Research Models</h4><p>In certain cases, particularly industrial ones, repurchases can be described using mathematical models such as the Poisson process. When these models are applied appropriately, a handful of base parameters are derived that succinctly describe a customer’s probabilistic behaviors around reordering. Comparing these parameters across different time periods can give a much stronger signal of change relative to basic methods. Aggregate your results over many customers to find the most important trends affecting your top line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*N5jgnAXqtZhFp_0L.png" /><figcaption>A poisson process shown for different values of the lambda parameter</figcaption></figure><h4>Identify Experimental and Long-term Substitutions</h4><p>Substitution analysis can be further improved by overlaying search, browsing, and cart modification behavior that preceded the purchase. See later sections for more.</p><h4>Incorporate Pricing History</h4><p>If pricing is fluctuating, make sure to track pricing history and then derive simplified vectors (up/down, a lot/little) to describe recent changes and overall change. Price fluctuation data can enhance all of the above models. For example, if we think that a customer is experimenting with a substitute, our confidence in that theory will increase if there is a large coinciding price increase.</p><h3>Browsing and Search Behaviors</h3><p>Hopefully you’re already tracking user activities such as page views, button clicks, searches, etc using some sort of event stream<em> </em>(ex: Segment).</p><p>A very simple place to start is changes in aggregate behavior prior to checkout. For example, maybe a customer that was reliably only using the reorder tool is suddenly instead using site tools to browse before ordering. Another simple case: maybe a customer is comparison shopping for longer before ordering new items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*8YcdSQddDK1VlDQ7" /></figure><p>The next step may be to break activity sessions down into <em>subsessions</em>, where each subsession contains all of the events related to exploring or/and purchasing a single type of item. The subsession can then be characterized by duration, number of actions, outcome, etc.</p><h3>Establish Leading Indicators for Intervention</h3><p>A leading indicator gives the earliest possible sign that an important event is likely to occur in the future. The classic example is for churn (a lagging indicator): sophisticated companies monitor customer behavior for early indicators that a churn is coming, and then intervene before that can happen.</p><p>As you iterate on the above approaches to identifying customer behavior changes that warrant intervention, you’ll decide which are the earliest and most accurate signals to use.</p><h4>Even if Prices Aren’t Changing Much, Implementing These Models Will Focus Your Interventions and Reduce Your Churn</h4><p>Many of the above tools and methods are advisable to implement regardless of tariff environment. Is a particular product being tried once by customers but then usually substituted with another? It would be good to understand why and then correct the problem. Is a customer suddenly exhibiting markedly different browsing behaviors or reorder patterns? Something has probably changed with personnel or process and an well-timed reachout will have high payoff.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*gt-Kvd3WCkf4iWdd" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b6660aa334" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/tariffs-and-inflation-get-early-signals-of-shifting-customer-behavior-69b6660aa334">Tariffs and Inflation: Get Early Signals of Shifting Customer Behavior</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Looker Design Guide for Rapid Scaling]]></title>
            <link>https://blog.flatirondata.ai/flatirons-looker-design-guide-d9f517a40a66?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9f517a40a66</guid>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[looker]]></category>
            <category><![CDATA[flatiron-data]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[bi-tools]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 20:25:33 GMT</pubDate>
            <atom:updated>2025-01-16T19:21:14.999Z</atom:updated>
            <content:encoded><![CDATA[<p>Satisfy power users’ data hunger without confusing the lay user. Let power users confidently explore without documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*U2yO4lp02U648t_-9YKhPQ.png" /><figcaption>It is, in fact, possible to build for everyone at once</figcaption></figure><h3>Table Stakes</h3><h4>More Small <a href="https://cloud.google.com/looker/docs/viewing-and-interacting-with-explores">Explores</a>, or Fewer Big Ones?</h4><p>The latter. Your power users are going to need as many connectable fields as possible, there’s no sense in trying to predict which connections they’ll be making and which they can do without. Rather, use design patterns in this guide to make even the biggest explores accessible to the lay user, empowering confident ignoring of most fields.</p><h4>Parallel <a href="https://cloud.google.com/looker/docs/reference/param-model">Models</a> for Rookie Users? No</h4><p>Not worth doubling your overhead, just organize things according to the design principles in this guide.</p><h4>Logic in Your SQL Codebase, Not LookML</h4><p>A view should typically be nothing more than a simple window into an underlying table. Keep all of your logic in one place (your SQL codebase) and your testing robust. Doing the opposite significantly increases the likelihood of error as well as difficulty of new developer onboarding.</p><h4>Make <a href="https://cloud.google.com/looker/docs/lookml-terms-and-concepts#view">Views</a> Modular</h4><p>A single view should not have 98329832978 fields. More than 25 is questionable. By modularizing views, you achieve both increased usability/organization as well as make it easier for yourself to build new explores quickly.</p><p>Our tables follow Flatiron’s <a href="https://medium.com/flatiron-data-ai/flatirons-more-modular-star-schema-05436c8cc990">more modular approach to table design</a>, and therefore we expect tables and views to have a 1:1 relationship and also to achieve modularity by default.</p><h3>Explore Design</h3><h4>Use Asterisks to Elevate Base View and Key Views</h4><p>Add “**” in front of a base view name to bring it to the top of the views list. Add “*” to 1–4 other views to bring them under the base view.</p><p>(note that in Looker a view will have the same name all throughout the LookML but it can have a different <em>display name</em> for every instantiation)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*fBE5BicFLKyNCrleB0SmLA.png" /><figcaption>Use a double asterisk to elevate the base view, use single asterisks to elevate critical views for the explore</figcaption></figure><h4>Sometimes: Rename Views Depending on the Explore</h4><p>ex: “client” -&gt; “buy-side client”</p><p>(subtler examples exist in plenty but all elude your author for the moment)</p><h4>Write Out a Diverse List of Business Questions, and See How to Answer Them</h4><p>The proof is in the pudding. If you can answer a diverse set of business questions with reasonable ease— and layer on caveats, qualifiers, etc — then your explore is probably decently designed.</p><h4>There Should Not be any “Common User Error”</h4><p>Easy ways to prevent something include default filters and really aggressive renaming (via display names).</p><h4>McGyver Your Way to “View Groups”</h4><p>A typical example of this would be — on the “orders” explore, for example — a set of views that all describe the customer (“customer,” “customer orders summary,” “customer app usage summary,” “customer ZIP demographics”). You’re likely to reuse this entire set of views in other explores as well.</p><p>“View Groups” is not a native Looker concept.</p><h4>Other Items</h4><ul><li>Pay careful attention to data access. Each company will have different needs here (ex’s: financial, clinical), the simplest approach is usually to use different <a href="https://cloud.google.com/looker/docs/reference/param-model">models</a>.</li><li>Use <a href="https://cloud.google.com/looker/docs/reference/param-explore-group-label">group labels</a> if you have lots of explores within a model</li></ul><h3>View Design</h3><h4>Asterisk any Key Fields</h4><p>Prefix any key fields with asterisks to move them to the top.</p><h4>Use Dimension Groups Liberally</h4><p>Ideally, we might say that a view should not have more than 7 unnested dimensions.</p><p><a href="https://cloud.google.com/looker/docs/reference/param-field-dimension-group#definition">Dimension groups</a> help users understand the context for the nested fields, and they also make the explore/view appear much less intimidating. Furthermore, you can do cheerfully aggressive things like call the dim group “Shipping Operations Advanced Users Only”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TjwUCgnqG2brlvu9" /><figcaption>One of dall.e’s takes on the term “cheerfully aggressive”</figcaption></figure><h4>Prefix Date Groups Uniformly, Highlight the Most Important One</h4><p>Because dates are already a dimension group, it’s not possible to further nest them. We recommend moving them to the bottom of a view by prefixing with something like “zDate” (ex: “zDate Booking Created”).</p><p>One view may have many dates, and this can be the biggest source of confusion/frustration for users. For example, a single hospitality transaction can have: when the record was created in the system, when the payment went through, and when the actual booking will occur. Use either name adjustments or tooltips to explain to users which is the default date or which date should be used when.</p><h4>Prefix Boolean Fields Uniformly and Clearly</h4><p>ex: is_first_booking; ex: has_liquid_item</p><h4>Hide Foreign Keys</h4><p>As an example, “customer id” should only be visible in the “customer” view. Often what happens is that customer id is present in 5+ views in an explore, and the user is left very confused as to which they should use.</p><p><em>This blog and its contents belong to </em><a href="https://flatirondata.ai/"><em>Flatiron Data</em></a><em>, which is led by unicorn builders and provides embedded data teams as a service.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9f517a40a66" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/flatirons-looker-design-guide-d9f517a40a66">Looker Design Guide for Rapid Scaling</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Unicorn Builders’ Guide to Business Health Metrics]]></title>
            <link>https://blog.flatirondata.ai/the-unicorn-builders-guide-to-business-health-metrics-d1b81458a74c?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1b81458a74c</guid>
            <category><![CDATA[business-health]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[okr]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Sun, 24 Nov 2024 20:59:45 GMT</pubDate>
            <atom:updated>2025-01-10T16:25:02.113Z</atom:updated>
            <content:encoded><![CDATA[<p><em>We often develop metrics and frameworks in new industries where there isn’t an accepted best practice. Even within established industries we find ourselves addressing crucial blind spots. Here is our “first principles” guide.</em></p><p><em>This guide focuses on the top-most level of business health analysis. Drill-downs can be found in subsequent guides.</em></p><h3>Start by Asking The Questions Out Loud</h3><p>Internalize your true priorities by asking these out loud:</p><ul><li><strong>Robustness of offerings — </strong><em>“Why are customers buying from us? Will this continue? Why do we lose customers? How do we strengthen customer loyalty and spend?”</em></li><li><strong>Consistency of outcomes<em> — “</em></strong><em>Are we delivering operationally where we need to? What are our key product deficiencies?</em><strong><em>”</em></strong></li><li><strong>Trending financial soundness — </strong><em>“Is our gross income positive? What is the payback on marketing dollars spent? When will we reach full profitability?”</em></li><li><strong>Effectiveness of internal culture and talent<em> — </em></strong><em>“How effective is our organization compared to corporate headcount?”</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TORKfW9IIm-04U67.jpeg" /><figcaption>We strongly recommend asking these questions out loud in conversation; simply reading them doesn’t have the same effect</figcaption></figure><p>New customer growth is usually the last item on our list — marketing dollars can easily masks a brittle business barely held together.</p><h3>Before Metrics: List Units of Analysis, Plan Out Personas and Other Key Splits</h3><p>Units of analysis — each suited to different questions — include transaction, customer, and cohort. Top ways to segment — i.e. split — analyses are by customer persona, geographic market, and offering type+tier. These segmentations can expose much larger and insightful effect sizes than an overall average and strongly inform strategy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/0*TBbI-SVkL0LMl9_M.jpg" /><figcaption>Analysis segmentation: a Broadway ticketing app mustn’t pay large amounts to acquire single-use tourists. Inversely, it will be a strong business if its users are mostly local and attend multiple shows per year</figcaption></figure><h4>Customer Persona is Usually the Most Critical Segmentation</h4><p>A company’s customers rarely all have the same needs, constraints, and responses. MarkStrat alums will remember the D2C <a href="https://www.stratxsimulations.com/latest_materials_markstrat_web/enu/Handbook-SM-B2C-DG/DocToHelpOutput/NetHelp/default.htm#!WordDocuments/sonitecustomers.htm">Sonite</a> and <a href="https://www.stratxsimulations.com/latest_materials_markstrat_web/enu/Handbook-SM-B2C-DG/DocToHelpOutput/NetHelp/default.htm#!WordDocuments/voditecustomers.htm">Vodite</a> archetypes, for example. A B2B vendor can segment clients by size and industry, among many other variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*uRVh1wNEfxrbXfbC.jpeg" /><figcaption>Image credit: Up Strategy Lab</figcaption></figure><p>Persona development may be split further into <em>marketing personas</em> and <em>customer personas</em>. Once a marketing lead becomes a customer, a company typically has significantly more information to more accurately classify the customer.</p><p>Persona development and refinement is a continuous process. At the “quick and dirty stage,” qualitative hypotheses made by revenue team leaders — perhaps also incorporating user interviews — may be effective enough. A data team can quickly test classifying customers into those groups and see if the groups distinguish themselves in behavior. We always advise incorporating as much external data as possible (ex: census income averages tied to ZIP code) to increase the accuracy of categorization.</p><p><a href="https://clfo2014.medium.com/using-customer-segmentation-to-create-customer-personas-34366a5f5925">Clustering</a> is an algorithmic approach to developing personas. In addition to intrinsic attributes, customer behavior sequences can also be inputs to these models. These models require no human-generated hypotheses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p1CMcsmlVkCjImII.png" /><figcaption>K-means is the most popular customer clustering algorithm. Image credit: DataCamp</figcaption></figure><h3>Retention is the Most Encompassing Metric</h3><p><em>Retention</em> measures whether customers are returning, and usually represents the single best quantification of competitive value being offered. In some cases <em>referral rate</em> may substitute.</p><p>Time-based cohorting provides a strong start for understanding D2C retention. A north-star company OKR might be <em>“Retention of a cohort after 2 years is 55%.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*5-r13EQszAY8pMh7.png" /><figcaption>A typical retention curve shape for subscription services and apps. A quick-start technical guide to defining D2C retention can be found <a href="https://medium.com/flatiron-data-ai/retention-churn-reactivation-and-value-succinct-technical-definitions-b5e66bb734f0">here</a>. Image credit: Matt Mazur</figcaption></figure><p>For companies with<em> cross-sell</em>, we advise high level views into cross-sell sequence (product b -&gt; product e) and <em>whether customers continue with the new offerings</em> or revert back to only the offering they began with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*66K47l6sgbt0b9sl.jpg" /></figure><h4>Dig Deep ASAP into the Key Value(s) to Customers</h4><p>This inquiry is critical, and yet often kicked down the road. <em>Without it retention will simply be a black box</em>. There is absolutely no reason for a company to guess — perhaps incorrectly or/and incompletely — at the value that current and potential customers are looking for. Misalignment is extremely costly and may not be rectified until it’s too late (we’ve seen some things…).</p><p>Customer interviews, surveys, and focus groups kick off a strong value delivery framework. In these interviews, avoid leading questions and neutralize bias in analysis (firstly by diversifying the analysis team). A data team’s role in this process is to help in design level inquiries, characterize effect size of reported phenomena, and estimate whether the majority of customers have likely been represented in the qualitative research conducted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*7lE_SM8Xw71Eisrx.jpg" /><figcaption>In “What Women Want” an ad man is given the supernatural ability to mind-read his assigned demographic</figcaption></figure><h4>Measure the Key Values Offered, by Hook or by Crook</h4><p>Once competitive values have been determined, <em>delivery of these values must be measured in every manner possible</em>. One might have to get creative, tool additional information capture within a software platform, scrape the internet, or accept imperfect proxies.</p><p>For example, if a ticketing app’s users are mostly looking for the best price, continuously scraping competitors’ prices and understanding pricing position in real time is crucial. If, instead, the app’s users are compelled by rich event discovery, begin by measuring the frequency of various behavior paths and their outcomes.</p><h4>Quantify Loyalty and Switching Costs; Monitor Conditions for Customer Departure</h4><p>Continuously quantify the potential value of evolving competitors to current customers, as well as the likelihood of the market reaching dangerous switchover conditions or step increases in CAC.</p><p>These models can also incorporate approximations of stickiness and loyalty via cross-sell, upsell, free resources, incentives, deep integration, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*E2ICZzlgzJkgRRXB.png" /><figcaption>Attrition models can get intense, but they start out as a few metrics coupled with disciplined intuition. Image credit: Minh-Tri Ha et al.</figcaption></figure><h4>Accurately Monitoring “Churn Reason” is of Highest Importance</h4><p>In D2C and SMB B2B industries it can be tempting to treat churn as natural and not dig in with the care of an archaeologist. However, we would advise investing in a combination of operationalized churn reason surveys, churned users &lt;&gt; key events analysis, and periodic user interviews (to confirm that the former 2 are not structurally biased or out of date). Letting customers dictate company strategy can be significantly cheaper and more effective than alternatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AwnQ6bg2H27krG1z.png" /><figcaption>Plug the flow out so that you keep growing and can accept a high CAC. Image credit: David Pakman</figcaption></figure><h4>Retention is a Lagging Indicator; Stay Ahead with Leading Indicators</h4><p>It may take a few months for an unexpected drop in retention to become clear; for starters, a month-based cohort model can’t show anything within the most recent 30 days. Obviously, an earlier signal would enable lucrative preventative corrections.</p><p>Counting churns on a given day definitely provides an earlier signal. But oftentimes an even earlier signal can be found, such as a subscription pause, a bad service experience, a focused search that did not lead to a purchase, or any other event that is found to correlate with a churn down the line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*feq0gR1-qM3VJjJG.png" /><figcaption>Leading indicators are especially sought after by exchange traders. Image source: Earn2Trade</figcaption></figure><h3>Operations and Product Metrics Are Specific to a Business, but Every Business Has Existential Ones</h3><h4>Most Important: Don’t Miss Crucial Operations Categories</h4><p>Flatiron finds surprisingly often that companies haven’t fully identified their operational priorities. This is closely related to identifying the value that customers are seeking, as discussed in earlier sections.</p><p>How can this happen? Consider a telehealth service that has built its own patient&lt;&gt;physician platform but also uses a vendor like ZenDesk for non-medical customer service. ZenDesk is quickly configurable to measure response times, satisfaction, issue type, etc and so companies can easily focus on these metrics. Customer service associates and managers are also used to logging this information, and therefore enablement needs are minimal. On the other hand, measuring efficacy of treatment, protocol adherence, physician responsiveness, physician response quality, physician bedside manner, and execution of follow ups is much more difficult, despite these being even more important to customer outcome and retention. <em>Critical, avoidable damage</em> <em>can occur</em> while initiatives to add cross-sell offerings, for example, overshadow stabilization of anchor offerings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9CahmYsWwd0hbxmv9Yc_CQ.png" /><figcaption>Measuring medical interaction quality and treatment efficacy is crucial to the success of a medical organization, though measuring it might be a headache initially</figcaption></figure><p>The starting method of understanding operational necessities and shortcomings is, again, surveys and interviews. Survey churned customers by any means necessary, and also survey existing customers at random to obtain feedback and potential warning signs. These learnings must be turned into observable metrics, no matter how imperfect.</p><h4>Define Outcomes, Which Might be More Complex Than A Single Event</h4><p>Simple example: a positive outcome often or intrinsically requires multiple interactions with customer service. The unit of analysis is not a single interaction, but rather the combination of multiple interactions. Measurements of note would include number of interactions required, calendar days to achieve resolution, outcome, and CSAT rating.</p><h4>Don’t Lose Operational Insights When Building Software</h4><p>Product features often begin as manual operations. Eventually — because quality can’t be maintained through freaky spreadsheets forever or because the cost is out of hand — new work is added to the product roadmap to replace these manual operations with software.</p><p>When this happens, it’s important not to drop monitoring of outcomes. Far less interesting than whether a new feature is used was whether it is being used successfully; success is defined as the customer achieving everything they were expecting to, with relative ease.</p><h4>Hot Take: Operations People and Data</h4><p>Operations teams are, in Flatiron’s experience, the most hot blooded in a company. A special breed, the best ones accept no roadblocks and take no prisoners. They see nothing but 3x-ing their KPIs by yesterday. A particularly impressive ops leader once described her reports to us as “pit bulls” waiting to be released; your author responded that the dog breed did not deserve such a comparison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*XqEGeXf8lRHPAZOF.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*flNr-gxWAY5eza25.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/0*oOEkO6p0ypNWaiJw.jpg" /></figure><p>These are the people you want on your team. They make it — whatever “it” is — happen. But, if anyone is going to MacGyver a metric together on their own because the data team needed a few days still, it’s them. If anyone is guess-writing SQL for the very first time to diagnose an expensive problem cause, it’s them. Admirable in theory, in practice this ethos results in chasing phantom problems, missing real ones, and evenintervening in the opposite direction of what’s needed.</p><p>Balancing the competing directives of “get it done by last month” and “wait for the data team to get to your requests” can be tricky at best, explosive at worst. Proactive care should be exercised in this regard by constantly considering thoughtful concerns voiced by both parties.</p><h3>Prioritizing the Interventions that Achieve Profitability</h3><p>All businesses eventually need to be profitable, and the sooner the better.</p><p>A company needs to determine which customer groups are generating strong gross returns, and which are not. For the latter, are there interventions that will improve the math? If not, how can loss groups be eliminated? For profitable groups, what is the path to covering overhead expenses after <a href="https://www.chargebee.com/resources/glossaries/cac-payback-period/">payback</a>?</p><h4>Unit Margins: Profit/Loss on Each Individual Transaction</h4><p>For any single item or receipt we want to know total revenues less the total <a href="https://www.investopedia.com/terms/v/variablecost.asp">variable costs</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Di7t6stQaJdU6FeK.jpg" /></figure><p>For accurate analysis, <em>push as many costs as possible into the variable category</em>. For example, if a B2B contract requires a certain amount of administrative effort every month, apply administrator salary, benefits, IT costs, and even office rent pro rata to each contract as variable costs.</p><p>Early-stage companies typically have exact numbers for revenue but have to approximate heavily on the cost side. Proper segmentations —which include fulfillment/service location, service levels, process/materials variations, and shipping variables — can strongly improve the shelf-life of these approximations. Flatiron once worked on a bespoke medical device costing project that required several full-time engineers and analysts 5 months to reconcile different costing systems for a single SKU across 30 interchangeable manufacturing partners with homegrown APIs; the client was very willing to invest heavily as it pushed to reach gross profitability.</p><p>A <a href="https://foodinstitute.com/focus/what-does-aerofarms-bankruptcy-signal-for-ceas-future/#:~:text=Last%20week%2C%20AeroFarms%2C%20the%20most,indoor%20farming%2C%20according%20to%20Pitchbook.">cautionary tale</a> of fundamentally unsound unit costs is indoor vertical farming. During the pandemic nine-figure sums were invested in these capital-intensive farms of the future, despite no hope of variable electricity costs reducing to below unit sale price. A few years later, most of these companies have folded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XRarbIO0_EFdqhVI" /><figcaption>Nine-figure investments in indoor farming were lost to insurmountable negative unit margins.</figcaption></figure><h4>Use Unit Margins to Calculate Customer Payback Period and Returns</h4><p>One end goal here is to channel more resources to marketing/sales efforts with strong returns. Another may be to attempt reducing operational costs for certain segments. <em>The</em> <em>analytic lens advised here is that of the marketing cash machine</em> — for every dollar in, when does the cash machine pay back that dollar and then how much is earned after that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/0*yPJsLGH5UTHLH_ZA.png" /><figcaption>A commonly used benchmark for marketing payback period is 15 months, up to 2 years if growth needs to be more aggressive.</figcaption></figure><p>In D2C a typical approach is to cohort customers by month joined and either acquisition method or entry point (ex’s: first purchase product, promotional discount) or both. Each cohort’s contributions to gross income can be tracked over time.</p><p>In a B2B business, time-based cohort segmentation may be less practical than other properties like industry, company size, or starting plan tier.</p><h3>Effectiveness of Company Culture, Talent, and Organization</h3><p>Flatiron has observed that companies avoid these inquiries until challenges can no longer be ignored, a bar that might take too long to reach. It is our assessment that <em>measuring the effectiveness and efficiency of a corporate organization is of the same importance as retention or gross profitability</em>.</p><h4>Don’t Skip the Most Basic Question: Is Your Org Aligned With Your Customers?</h4><p>Does this seem obvious? We don’t know if it does, because with some regularity we see large organizations somewhat oblivious to the realities of their customer base. <strong>We beseech you to prioritize this question.</strong></p><p>There are many ways this disconnect can come to be. Biased assumptions are never cross-examined. Analytic viewpoints lack diversity. Media needs a certain story, and that story then shapes the internal narrative. An altruistic mission is more personally fulfilling, especially when repeated into truth. Wheels have gathered speed on their own over time and no one is checking the map. The list goes on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hXCQZedWrcRExDMI" /><figcaption>Strategic conversations out of touch with reality result in eye-popping amounts of capital and time down the drain</figcaption></figure><p>Measuring org alignment with current and future customers is an art as much as a science. It begins with steps outlined in earlier sections regarding establishing and measuring value propositions through objective means.</p><h4>Second Basic Question: Who Knows What “Good” Looks Like? What Data and Influence Do They Possess?</h4><p>Those who can provide the most objective assessment of a team are often not the team leaders. Rather, it is experienced individuals (with a resume of several strong workplaces) who work with the team constantly. It is usually extremely helpful to enlist them in properly leveraging any team performance metrics collected or designing the metrics and setting benchmarks.</p><p>Establishing a healthy, constructive version of this process requires delicacy and fortitude.</p><h4>Measuring Engineering Teams</h4><p>Engineering teams are often the most expensive, most opaque to general management, and the most critical internal bottleneck. Flatiron has been involved in numerous projects to measure output of software teams. Oftentimes reporting is automatically provided within work management tools like Jira, and enabling this reporting requires minimal process changes. The challenge, however, is sizing tasks in a manner that is consistent across all engineers but then also to benchmark companies. The most effective solution here is seasoned managers who are technical enough to know what tasks “should” take and can enforce a standardized system of “points” estimation and subsequent adjustment for a task. These managers should also be able to assess whether total points output is consistent with a high performing team.</p><p>It can also be helpful to track, in extra detail, a few critical task types or time-consuming problems that repeatedly arise. This information can be extraordinarily helpful in justifying extra effort for tech debt erasure, process changes, personnel changes, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h1RB3pbfbiTJDAip.jpg" /><figcaption>Image credit: Michigan Technological University</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1b81458a74c" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/the-unicorn-builders-guide-to-business-health-metrics-d1b81458a74c">The Unicorn Builders’ Guide to Business Health Metrics</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flatiron’s More Modular Star Schema]]></title>
            <link>https://blog.flatirondata.ai/flatirons-more-modular-star-schema-05436c8cc990?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/05436c8cc990</guid>
            <category><![CDATA[analytics-engineering]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Fri, 08 Nov 2024 02:14:10 GMT</pubDate>
            <atom:updated>2025-01-10T16:20:37.137Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Roughly parallel to a “services” application architecture, the results of our adjusted organization are smaller blocks that are easier to understand at a glance and utilize safely; faster building and simpler maintenance; and no ambiguous and bug-ridden staging tables.</em></p><p><em>Some of these ideas were originally developed and published </em><a href="https://medium.com/dandy-engineering-blog/dandy-star-schema-394d96369868"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Px8z0swsMcfQPbSUfb1vzA.png" /></figure><p>In a <a href="https://en.wikipedia.org/wiki/Star_schema">traditional star schema,</a> the fact and dim table types — which often have have hundreds of columns — pull from a network of ungoverned staging tables that have to be traced through by each new (or rusty) developer. They can often become intertangled or, at a minimum, bug-ridden in silence. Analysts will use staging tables directly, often incorrectly or with a good deal of verification required. The dim tables in particular have many, many aggregations, and both table types will include what we call “derived” data.</p><p>We distinguish between the idea of <em>essence data</em> — such as the the timestamp of a fact or the unique identifier of a dimension — and <em>derived</em> <em>data</em> such as the number of purchases a customer has made. Essence data can only be found on the fact/dim table and cannot be pulled or calculated from anywhere else. The opposite is true for derived data.</p><h3>Changing the Rules</h3><p>We’ve made these changes:</p><ol><li>Fact and dim tables should be wholly restricted to essence data</li><li>Severely reduce the number of staging tables, and re-prefix them by purpose</li><li>Introduce a variety of smaller derived data tables which most often pull from only two essence tables; these tables are extremely intelligible to analysts or developers from the outset, and easily maintained</li></ol><h3>Table Types</h3><h4>Dimension (Dim)</h4><p>(ex: dim_customer)</p><p>As is traditional, the rows in dimension tables represent entities that are long-lived. In the example of dim_customer, likely fields include: customer_id, linking id 1, linking id 2, name, address, joined_date.</p><p>The name of the table usually involves a singular noun rather than a plural one. Essence data only.</p><h4>Fact</h4><p>(ex: fact_purchase)</p><p>Fact tables typically record temporal occurrences. In the example of fact_order, likely fields include: order_id, customer_id, shipping_address_id, time_created, status, assorted product information fields).</p><p>The name of the table usually involves a singular noun rather than a plural one. Essence data only.</p><h4>Aggregation that Extends a Dimension (AggDimExt)</h4><p>(ex: aggdimext_customer_purchases_summary)</p><p>(ex: aggdimext_customer_messages_summary)</p><p>An aggregation that extends a dimension takes in fact and dimension tables and aggregates them so that the final table can be joined one-to-one with a dimension table. For the example of aggdimext_customer_purchases_summary, we can take the fact_order table and aggregate by customer_id. Fields that we aggregate to might include number of orders, first order date, and last order date.</p><p>In the naming of these tables, the name of the dimension is singular while the remainder of the name usually contains a plural of some form</p><h4>Aggregation that Extends a Fact (AggFactExt)</h4><p>(ex: aggfactext_invoice_invoice_line_items_summary)</p><p>The same ideas apply here as with aggdimext, but the aggregation query groups by a fact id instead of a dimension id. In this example, we are grouping the line items for an invoice up to the level of an invoice, but an invoice is itself a fact.</p><h4>Fact Grouping Sequence (FactGroupingSequence) + Fact Grouping (FactGrouping)</h4><p>(ex: factgroupsequence_bookings_to_trip; factgrouping_trip)</p><p>Sometimes, facts can be grouped into a higher-level fact that we call a “fact grouping.” For example, multiple hospitality bookings by a customer within a few days of each other might constitute a vacation or trip, even if the hospitality company does not formally track such a concept. A better known example is clickstream event sessionization.</p><p>The cleanest approach is to first create the “fact grouping sequence” table, which is 1:1 with the fact table and includes a mapping id to the grouping as well as sequence-based information (ex: days since trip start).</p><p>This sequence table is then aggregated to create the “fact grouping” table. A unique id for each grouping corresponds to the mapping from the sequence table. Summary information is also provided (ex: # of bookings, days duration of trip).</p><h4>Aggregation (Agg)</h4><p>(ex: agg_cohort_retention)</p><p>For other aggregations. There aren’t too many rules for these.</p><h4>Date Spine Cross Joined with Another Table (DateSpineCross)</h4><p>(ex: dataspinecross_cohort_customer_purchases)</p><p>The case for cross joining a date spine to another table comes up more often than one might expect. We give this type of table a special designation in our warehouse so that its structure is immediately clear to all who inspect the table.</p><h4>Staging (Stg)</h4><p>We avoid staging tables where not logically necessary — there is no need for an extra layer of complexity. Unlike in certain paradigms, we do not have queries for fact/dim/etc tables whose only logic is to cherrypick fields from an underlying staging table. We are also very comfortable having the queries for any fact/dim/agg/aggdimext/etc tables involve numerous CTEs (usually this setup is easier to copy into a db idea for debugging). Staging tables should only exist where there is a logical need for them.</p><h4>Utility Tables (Util)</h4><p>One of our use cases for utility tables is unusual mappings that we have between entities where we had to define the mapping logic on the data team side instead of having that mapping pre-defined in production data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05436c8cc990" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/flatirons-more-modular-star-schema-05436c8cc990">Flatiron’s More Modular Star Schema</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DIY TV Attribution]]></title>
            <link>https://blog.flatirondata.ai/diy-tv-attribution-4d93d06aace5?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d93d06aace5</guid>
            <category><![CDATA[marketing-attribution]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[tv-attribution]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 19:32:27 GMT</pubDate>
            <atom:updated>2024-11-08T02:43:25.674Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A client asked us to validate what their marketing agency was reporting in terms of attributable visitors and purchases.</em></p><p><em>This is a basic, easily executed how-to for estimating TV-attributable traffic numbers immediately after a commercial airing. The main prerequisite is an events clickstream or some other timestamped log of visitors as they first enter and then navigate the site. It is not necessary to have separate landing pages or source referral tracking.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*eagHEqy3vfJ4ffQk" /></figure><p>TV commercials tend to drive a high amount of traffic within a relatively concentrated period of time. They also drive a long tail of site traffic over the next day/days/weeks.</p><p>One of the first steps for TV commercial site traffic attribution is to identify spikes in traffic. This article outlines the first iteration of an algorithm we’ve previously used to identify said spikes. It’s usually sufficient to provide early order-of-magnitude estimates.</p><p>The most advanced mathematical function used here is <a href="https://en.wikipedia.org/wiki/Convolution">convolution</a>, used for signal smoothing. You can definitely employ this algorithm without understanding the mechanics of how convolution works.</p><h3>The Starting Anomaly Detection Algorithm: Z Score Thresholding</h3><p>Begin with the <a href="https://stackoverflow.com/a/22640362/6029703">“smoothed z score algorithm”</a> (see also: <a href="https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data/43512887#43512887">python implementation</a>). With a name far more complex than its implementation, this algorithm boils down to 25 lines of code and is based only on the concepts of average and standard deviation. The trickiest aspect is tuning the 3 parameters for optimal performance.</p><p>At any position in the signal, the smoothed z score algorithm essentially computes a trailing average of and a trailing standard deviation of the preceding window of data points specified by the <em>lag</em> parameter. If a point within the lag window is considered to be part of an identified spike/anomaly, this point is not given full value, but rather weighted only as much as the <em>influence</em> parameter. If the point at the current position has a value outside of ​​​​trailing average +/- ( threshold * trailing standard deviation) then it is considered to be part of an anomaly and marked as such.</p><h3>Creating A More Robust Thresholding Algorithm</h3><p>The Z Score algorithm is fairly robust for flat signals that experience intermittent spikes. However, traffic signals usually have a non-constant base (i.e. a daily cycle):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*suwe_LNu5xuiqZ37" /><figcaption>Example 7-day traffic with commercial spikes; we chose a granularity of 1 x-axis step = 3 minutes of time span</figcaption></figure><p>Attempting to use the basic Z Score algorithm results in either oversensitivity or undersensitivity (depending on how the parameters are tuned), with little middle ground.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*oksLOMZecgcsmX_g" /><figcaption>The best possible tuning of the forward pass still has serious issues. Sensitivity is either too low or too high within the same data set, regardless of tuning.</figcaption></figure><h4>Step1: Apply the Z Score Algorithm in Reverse</h4><p>The smoothed z score algorithm moves from left to right. If we apply the algorithm from right to left, we will get a different result which we can then compare against the original version.</p><p>Here is what this looks like in python:</p><pre>def thresholding_algo_reversed(y, lag, threshold, influence):<br>    signals = np.zeros(len(y))<br>    filteredY = np.array(y)<br>    avgFilter = [0]*len(y)<br>    stdFilter = [0]*len(y)<br>    avgFilter[-lag] = np.mean(y[-lag:])<br>    stdFilter[-lag] = np.std(y[-lag:])<br>    for i in reversed(range(0, len(y)-lag)):<br>        if abs(y[i] - avgFilter[i+1]) &gt; threshold * stdFilter [i+1]:<br>            if y[i] &gt; avgFilter[i+1]:<br>                signals[i] = 1<br>            else:<br>                signals[i] = 0<br>            filteredY[i] = influence * y[i] + (1 - influence) * filteredY[i+1]<br>            avgFilter[i] = np.mean(filteredY[i:(i+lag)])<br>            stdFilter[i] = np.std(filteredY[i:(i+lag)])<br>        else:<br>            signals[i] = 0<br>            filteredY[i] = y[i]<br>            avgFilter[i] = np.mean(filteredY[i:(i+lag)])<br>            stdFilter[i] = np.std(filteredY[i:(i+lag)])<br>    return dict(signals = np.asarray(signals),<br>        avgFilter = np.asarray(avgFilter),<br>        stdFilter = np.asarray(stdFilter))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*E3vBHY6GWfHsV21y" /><figcaption>Forward pass (top) vs. reverse pass (bottom)</figcaption></figure><h4>Step 2: Compute a New Baseline Signal From the Forward and Reverse Z Score Algorithm Results</h4><p>The inputs here from previous steps are:</p><ul><li>the forward pass moving average, computed previously</li><li>the reverse pass moving average, computed previously</li><li>the list of identified anomaly points from the forward pass, computed previously</li><li>the list of identified anomaly points from the reverse pass, computed previously</li></ul><p>New parameters introduced are:</p><ul><li>multiple_cutoff</li><li>yes_weight_within_cutoff</li><li>yes_weight_outside_cutoff</li></ul><p>For every point in the original signal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*6b64vertAurxOpoM.png" /></figure><p>Here’s what this looks like as python code:</p><pre>#initialize arrays of zeros<br>std_combined = np.zeros(len(std_forward))<br>avg_combined = np.zeros(len(avg_forward))<br>#new parameters<br>multiple_cutoff = 1.5<br>yes_weight_within_cutoff = .8<br>yes_weight_outside_cutoff = .05<br>for i in range(0,len(avg_forward)):<br>    if avg_forward[i] == 0:<br>        avg_combined[i] = avg_reversed[i]<br>        std_combined[i] = std_reversed[i]<br>    elif avg_reversed[i] == 0:<br>        avg_combined[i] = avg_forward[i]<br>        std_combined[i] = std_forward[i]<br>    elif signal_forward[i] == signal_reversed[i]:<br>        avg_combined[i] = (avg_forward[i] + avg_reversed[i])/2<br>        std_combined[i] = (std_forward[i] + std_reversed[i])/2<br>    elif signal_forward[i]:<br>        if 1.0 * avg_reversed[i]/avg_forward[i] &lt; multiple_cutoff:<br>            yes_weight = yes_weight_within_cutoff<br>        else:<br>            yes_weight = yes_weight_outside_cutoff<br>        avg_combined[i] = (yes_weight) * avg_forward[i] + (1-yes_weight) * avg_reversed[i]<br>        std_combined[i] = (yes_weight) * std_forward[i] + (1-yes_weight) * std_reversed[i]<br>    elif signal_reversed[i]:<br>        if 1.0 * avg_forward[i]/avg_reversed[i] &lt; multiple_cutoff:<br>            yes_weight = yes_weight_within_cutoff<br>        else:<br>            yes_weight = yes_weight_outside_cutoff<br>    avg_combined[i] = (1-yes_weight) * avg_forward[i] + (yes_weight) * avg_reversed[i]<br>    std_combined[i] = (1-yes_weight) * std_forward[i] + (yes_weight) * std_reversed[i]<br>    else:<br>        print(&quot;unhandled condition&quot;)</pre><h4>Step 3: Convolve the New Baseline Signal to Smooth It</h4><p>Our use case for convolution is essentially to smooth our new signal in a way that is better than a simple trailing average (which only incorporate data to the left of the point being smoothed). Here we’ve applied a short horizontal line as the convolution signal — the sum of the values of each of the points in the signal is 1. For our use case the convolution length (which can be thought of as another tunable parameter) worked well as 40 (meaning that we’re smoothing every point with 20 points from the left and 20 points from the right).</p><p>In python, convolving can be done with the numpy library:</p><pre>avg_convolve_length = 40.0<br>avg_convolve_weights = np.ones(int(avg_convolve_length)) / avg_convolve_length<br>std_convolve_length = 2*avg_convolve_length<br>std_convolve_weights = np.ones(int(std_convolve_length)) / std_convolve_length<br>avg_combined = np.convolve(avg_combined,avg_convolve_weights,&#39;same&#39;)<br>std_combined = np.convolve(std_combined,std_convolve_weights,&#39;same&#39;)</pre><p>The convolution is applied to both the new baseline and the new standard deviation signals.</p><h4>Step 4: Re-identify Anomaly Points Using the New Smoothed Baseline</h4><p>This is quite basic. Given our new baseline signal and standard deviation signal, any points in the actual signal that are threshold standard deviations above the baseline are considered to be part of an anomaly spike.</p><p>The logic to do so is here:</p><pre>neighbor_threshold = .5<br>neighbor_in_between_threshold = -.5<br>neighbor_distance_range = 2for index in signal_combined.nonzero()[0]:<br>    for distance in range(1, neighbor_distance_range+1):        if index-distance &gt;= 0 and \<br>            numsessions_array[index-distance] != 1 and \<br>            numsessions_array[index-distance+1] &gt; avg_combined[index-distance+1] +<br>            neighbor_in_between_threshold * std_combined[index-distance+1] and \<br>            numsessions_array[index-distance] &gt;= avg_combined[index-distance] +<br>            neighbor_threshold * std_combined[index-distance]:<br>                signal_combined[index-distance] = 1        if index+distance &lt; len(signal_combined) and \<br>            numsessions_array[index+distance] != 1 and \<br>            numsessions_array[index+distance-1] &gt; avg_combined[index+distance-1] +<br>            neighbor_in_between_threshold * std_combined[index+distance-1] and \<br>            numsessions_array[index+distance] &gt;= avg_combined[index+distance] +<br>            neighbor_threshold * std_combined[index+distance]:<br>            signal_combined[index+distance] = 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*9mPa3r9MGAuEEBXi" /><figcaption>Our new and improved anomaly detection</figcaption></figure><h3>Grouping Anomaly Points Into Spikes, Filtering Spikes Using TV Logs</h3><p>The new input here is:</p><ul><li>the tv commercial log</li></ul><p>How you proceed at this point is dependent on the desired granularity of attribution. On the simplest level, we just want to make sure that identified anomalies are within a reasonable range of an aired commercial — an anomaly that is 1 hr before/after the nearest commercial airing is in all likelihood not commercial related.</p><p>In our use case we were most interested in this analysis to get a top level figure of traffic/conversions that came in from television every week. This top level figure was compared to what our TV buying agency was reporting in order to give us confidence in their numbers. Once we had established confidence in this top level number we were happy to let them break down which channels/spots were the most efficient.</p><h3>Splitting Anomaly Groups Into Spikes</h3><p>Depending on how your anomalies look, how concurrent your tv commercials are, and what level of granularity you are aiming for you may also need to consider the need for splitting certain anomalies into multiple, overlapping spikes.</p><p>The simplest way to split up an anomaly group is to look for local minima (i.e. where the first derivative is 0) — these mark points in time where descending traffic from an earlier spike is overtaking by increasing traffic from a subsequent spike.</p><p>Here is a python implementation:</p><pre>import more_itertools as mitsignal_non_zeros_indices = signal_combined.nonzero()[0]<br>grouped_before_split = [tuple(group) for group in mit.consecutive_groups(signal_non_zeros_indices)]<br>def map_delta(delta):<br>    if delta &lt; 0:<br>        return -1<br>    elif delta == 0:<br>        return 0<br>    else:<br>        return 1<br>def split_group(group_tuple, sessions_array):<br>    if(len(group_tuple) == 1):<br>        return [group_tuple]<br>    split_local_indices = [group_tuple[0], group_tuple[-1]+1]<br>    for local_index in range(1,len(group_tuple)-1):<br>        pre_delta_map = map_delta(sessions_array[group_tuple[local_index]] - \<br>            sessions_array[group_tuple[local_index-1]])<br>        post_delta_map = map_delta(sessions_array[group_tuple[local_index+1]] - \<br>            sessions_array[group_tuple[local_index]])<br>        if (pre_delta_map * post_delta_map in [-1,0]):<br>            if post_delta_map == 1:<br>                split_local_indices.append(group_tuple[local_index])<br>    split_local_indices = sorted(split_local_indices)<br>    tuple_groups = []<br>    for i in range(0,len(split_local_indices)-1): tuple_groups.append(tuple(range(split_local_indices[i],split_local_indices[i+1])))   <br>    return tuple_groups<br>grouped = []<br>for group_tuple in grouped_before_split:<br>    grouped = grouped + split_group(group_tuple, numsessions_array)cutoff_added_sessions = 0spikes_dict = {}<br>for group in grouped:<br>    above_ma = 0<br>    for index in group:<br>        above_ma += numsessions_array[index] - avg_combined[index]<br>    if above_ma &gt;= cutoff_added_sessions:<br>        spikes_dict[group] = round(above_ma,1)grouped=spikes_dict.keys()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*wvD4NGNZA5C39qdm" /><figcaption>Top: Signal anomalies divided into distinct spikes — consecutive spikes have different colors; the black dots on the bottom represent tv spots airing — the majority of commercials were not run exactly concurrently with each other, but in some cases there were 2 (and even 3 and 4) commercials running concurrently | Bottom: Each spike is given an overall magnitude, equal to the total number of sessions attributed to the spike above the baseline signal.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*AJidkL3rLAr1qlpU" /><figcaption>A zoomed in version of segmenting anomaly groups into distinct spikes, each with a different color; the baseline signal and standard deviation signals are illustrated with dashes; the black dots represent tv commercials, and a black dot on the lower tier represents two commercials running within the same time window</figcaption></figure><p>It is important to note that these local minima don’t identify the divisions between spikes, which are in fact overlapping; rather, they identify the point in time where the later spike “overpowers” the earlier one.</p><h3>Extension: Granular Value Attribution for Concurrent Commercials</h3><p>If you are</p><ol><li>looking to assign specific values to individual commercials and</li><li>are running lots of commercials within minutes/seconds of each other and can’t simply match every commercial with the nearest spike</li></ol><p>you will need a more sophisticated solution to commercial&lt;&gt;spike matching. One contender here is <a href="https://en.wikipedia.org/wiki/Constrained_optimization">constrained optimization</a> (see also: <a href="https://multithreaded.stitchfix.com/blog/2018/06/21/constrained-optimization/">constrained optimization in python</a>).</p><p>The objective would be:</p><ul><li>maximize the number of spikes attributed to commercial airings + the number of commercial airings attributed to a spike</li></ul><p>Constraints would include:</p><ul><li>a spike must begin within a defined period of time from the nearest commercial airing (ex: 3 minutes)</li><li>a single commercial can only yield a single spike, though a single spike may be the result of multiple commercials</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d93d06aace5" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/diy-tv-attribution-4d93d06aace5">DIY TV Attribution</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retention, Churn, Reactivation, and Value: Succinct, Technical Definitions]]></title>
            <link>https://blog.flatirondata.ai/retention-churn-reactivation-and-value-succinct-technical-definitions-b5e66bb734f0?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5e66bb734f0</guid>
            <category><![CDATA[churn]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[retention]]></category>
            <category><![CDATA[business-health]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 20:22:09 GMT</pubDate>
            <atom:updated>2024-11-05T20:22:09.219Z</atom:updated>
            <content:encoded><![CDATA[<p><em>There can be a lot of ambiguity around definitions for user retention and value. Here is the most cogent combination of definitions that we’ve found.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2_di9gSZeJUsyeOG.png" /><figcaption>Reactivation after churn, personified [image credit: aircall.io]</figcaption></figure><h3>Basic Definitions</h3><h4>Boolean Measures</h4><p><strong>Member Churn</strong>: A member has churned if you believe that that member is gone for good. Churn is a boolean value (i.e. <em>yes</em> a customer has churned, or <em>no</em> a customer has not churned) — there is no in between.</p><p><strong>Member Retention</strong> is the inverse of churn. A member is retained if they have not churned. Retention is also a boolean value — a member is either retained or not retained, with no shades of gray.</p><h4>Events</h4><p><strong>Member Reactivation</strong>: If a member previously categorized as churned reappears and can no longer be categorized as churned, that member reactivated on the date when they switched from being classified as churned back to being classified as retained.</p><h4>Numerical Measures</h4><p><strong>Member Value</strong> (sometimes called customer lifetime value) is a measure of how much a member has contributed to a quantifiable objective, whatever you might define that to be. The important contrast here is that <em>two members that are both still retained may have very different values</em>.</p><h3>Deciding the Threshold for “Churned”</h3><p>Coming up with a threshold classification for a member becoming classified as churned can be done in a few ways.</p><p>A simple way is to look at time intervals between repeated actions taken by a member. Let’s take the example of a video game where we have good data about the time interval between plays. If we know that 95% of intervals are less than 2 weeks, then we can set the threshold that a member who hasn’t played in the last three weeks is deemed churned.</p><p>A more robust method for churn thresholding is to benchmark against reactivation. You can say “Let’s look at the members of that cohort who took the important action in time period __x__ relative to cohort start. The proportion of this group previously classified as churned should be less than __y__%.”</p><p>A concrete example of the this is “For any cohort, the percentage of cohort members purchasing 12 months into their lifetime that are considered reactivations should be less than 10%.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e66bb734f0" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/retention-churn-reactivation-and-value-succinct-technical-definitions-b5e66bb734f0">Retention, Churn, Reactivation, and Value: Succinct, Technical Definitions</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Motif for Stronger Eventstream Analysis]]></title>
            <link>https://blog.flatirondata.ai/motif-for-stronger-eventstream-analysis-d354ad4e79d3?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d354ad4e79d3</guid>
            <category><![CDATA[motif]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[event-analytics]]></category>
            <category><![CDATA[product-analytics]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 18:26:00 GMT</pubDate>
            <atom:updated>2024-10-25T18:26:00.804Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.motifanalytics.com/"><em>Motif</em></a><em> provides very different and powerful capabilities for exploratory eventstream analysis, but properly leveraging them requires earnestly going through tutorials. The most likely user of Motif is a Data Scientist, follow by BI Analysts and Product Managers; Operations Managers might also use it in a controlled setting. Looking at Motif’s blog and what they’ve accomplished since launching, we expect the capabilities of Motif to grow quickly, including in semi-supervised learning for categorizing users.</em></p><p><em>This independent review has been written by </em><a href="https://flatirondata.ai/"><em>Flatiron Data</em></a><em>.</em></p><h3>Review: What is an “Eventstream”?</h3><p>The term “eventstream” is most immediately associated with a “clickstream” that tracks an app or website user’s activity — including page views, clicks, and feature engagements — for the purpose of product improvement. A leading SDK for clickstreams is Segment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LKBKSC8uw5226zi0.png" /></figure><p>If we generalize this idea a bit, we can imagine turning all sorts of temporal occurences into events, from transactions to lab tests to messages to consultations. This forms an eventstream. An eventstream can provide useful insights to departments like operations, clinical, fp&amp;a, marketing, and many others.</p><p>All events in an event stream have an actor id, a timestamp, and a myriad of properties.</p><h3>Motif Initial Input Configuration</h3><p>Motif ingests events in a tabular format. Configuration is straightforward and familiar: parallels to actor, event name, and numerous basic properties are established. This configuration process is point-and-click and relatively painless.</p><h3>Filters and Transforms</h3><p>This is the first place where Motif’s capabilities really shine through; these are difficult to easily replicate within a tool like Amplitude or in SQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWa_ERJoOOtBPjwBHpyyYg.png" /></figure><p>One can filter down to users/sessions that display a particular pattern of events, with wildcards available (much like RegEx).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R1czwTy7yfMN2ht25l-Nvg.png" /></figure><p>Using the same internal language, groups of events can easily be combined into a single event. Replacing events — or removing them entirely — is also straightforward. Sessions can also be tagged.</p><h4>Sequence Operations Language (SOL)</h4><p>An expert user will manipulate events in Motif using its Sequence Operations Language (SOL) directly. An average user will write prompts in English that are translated with reasonable consistency by the AI interpreter, and the autosuggest is quite helpful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*vErrND3_kVISml-L.png" /></figure><h3>Main Visualization</h3><p>Motif’s core visualization tool is immediately much more helpful than standard funnel or Sankey diagrams. In the below screenshot, we can explore numerous funnel paths all at once, and then view detailed stats for a specific one. Simplification of pathways is straightforward, by removing initial events or reducing event patterns to a single event (possibly with new properties). The funnels also can be flipped to start on the right side, meaning that the anchoring events are the final ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jwt4lmj7JkyDlkQu.png" /></figure><p>Properties — both categorical and quantitative — can also be added to sessions, users, or events based on preceding event sequences or properties across multiple preceding events.</p><h4>Plots</h4><p>Motif makes it very easy to create 2D plots quickly derived from work in the main visualization window. Axes and facets can represent tags, frequency, and derived properties, among others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*VyhC7Y28Fi5YJLky.png" /></figure><h3>Causal Inference Tool</h3><p>Motif provides nearly plug-and-play capabilities for understanding contributing factors to specified outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-AKYzAmQrbqO6Scs.png" /></figure><p>This tool is extendable to “outcome prediction.”</p><h3>Case Studies and More Information</h3><p>For more information on Flatiron Data, please visit <a href="https://flatirondata.ai/">our website</a>. For more details on Motif’s capabilities and use cases, see <a href="https://docs.motifanalytics.com/">their documentation</a>. We’d recommend browsing their <a href="https://docs.motifanalytics.com/use-cases/overview">case studies</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d354ad4e79d3" width="1" height="1" alt=""><hr><p><a href="https://blog.flatirondata.ai/motif-for-stronger-eventstream-analysis-d354ad4e79d3">Motif for Stronger Eventstream Analysis</a> was originally published in <a href="https://blog.flatirondata.ai/">Flatiron Data &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dandy Star Schema]]></title>
            <link>https://medium.com/dandy-engineering-blog/dandy-star-schema-394d96369868?source=rss-f73756d4c3d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/394d96369868</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analytics-engineering]]></category>
            <category><![CDATA[star-schema]]></category>
            <dc:creator><![CDATA[Sami Yabroudi]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 19:42:03 GMT</pubDate>
            <atom:updated>2022-03-29T15:52:59.154Z</atom:updated>
            <content:encoded><![CDATA[<h4>We’ve taken the traditional star schema and modified it to be more modular. The result is smaller blocks that are easier to build with, debug, and move around; clearer interfaces; and fewer ambiguous staging tables.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bq7js2zFqUyjvmT3.jpeg" /></figure><p>The <a href="https://en.wikipedia.org/wiki/Star_schema">traditional star schema</a> consists of dimension tables (dim), fact tables (fact), and aggregation tables (agg). The rows in fact tables are typically records of a temporal occurrence (ex: fact_order) and the dimension tables capture lots of information about long-lived entities (ex: dim_customer). An aggregation table can select from fact or dim, but dim and fact can only select from staging tables. A dimension table like dim_customer can have many, many columns that are essentially aggregations of some sort (ex: total orders to date, total orders in first 3 months, etc) and that pull from staging tables with less defined organization.</p><p>At Dandy we’ve decided that the star schema can be made more modular. We can reduce the amount of information living in ambiguous staging tables, and we can break up dimension tables into pieces with clearly defined purposes and sources. Aggregations pertaining to a fact or dimension can safely build off of other fact/dim tables (which are clearly defined) rather than from staging tables that often mean different things to different people. More modularity, with clearly defined interfaces, also makes for less mistakes and very methodical debugging.</p><p>Additionally, for those who use Looker, more modularity in underlying tables allows for more modularity with Looker views. Smaller views can be easily moved around or added to different explores, meaning faster implementation times and less fields in a given explore.</p><p>At Dandy, we have the following table types:</p><h3>Dimension (Dim)</h3><p>(ex: dim_customer)</p><p>Our dimension tables are much lighter than the traditional dimension tables and contain few aggregations, if any at all. As is traditional, the rows in dimension tables represent entities that are long-lived. In the example of dim_customer, likely fields include: customer_id, linking id 1, linking id 2, name, address, joined_date.</p><p>The name of the table usually involves a singular noun rather than a plural one.</p><h3>Fact</h3><p>(ex: fact_order)</p><p>Fact tables typically record temporal occurrences. In the example of fact_order, likely fields include: order_id, customer_id, shipping_address_id, time_created, status, assorted product information fields).</p><p>The name of the table usually involves a singular noun rather than a plural one.</p><h3>Aggregation (Agg)</h3><p>(ex: agg_cohort_retention)</p><p>An aggregation tables takes information from fact and dim tables and aggregates it up somehow. There aren’t too many rules for them.</p><h3>Aggregation that Extends a Dimension (AggDimExt)</h3><p>(ex: aggdimext_customer_orders_summary)</p><p>(ex: aggdimext_customer_zendesk_conversation_summary)</p><p>An aggregation that extends a dimension takes in fact and dimension tables and aggregates them so that the final table can be joined one-to-one with a dimension table. For the example of aggdimext_customer_orders_summary, we can take the fact_order table and aggregate by customer_id. Fields that we aggregate to might include number of orders, first order date, and last order date.</p><p>In the naming of these tables, the name of the dimension is singular while the remainder of the name usually contains a plural of some form</p><h3>Aggregation that Extends a Fact (AggFactExt)</h3><p>(ex: aggfactext_invoice_invoice_line_items_summary)</p><p>The same ideas apply here as with aggdimext, but the aggregation query groups by a fact id instead of a dimension id. In this example, we are grouping the line items for an invoice up to the level of an invoice, but an invoice is itself a fact.</p><h3>Date Spine Cross Joined with Another Table (DateSpineCross)</h3><p>(ex: dataspinecross_cohort_customer_purchases)</p><p>The case for cross joining a date spine to another table comes up more often than one might expect. We give this type of table a special designation in our warehouse so that its structure is immediately clear to all who inspect the table.</p><h3>Staging (Stg)</h3><p>We avoid staging tables where not logically necessary — there is no need for an extra layer of complexity. Unlike in certain paradigms, we do not have queries for fact/dim/etc tables whose only logic is to cherrypick fields from an underlying staging table. We are also very comfortable having the queries for any fact/dim/agg/aggdimext/etc tables involve numerous CTEs (usually this setup is easier to copy into a db idea for debugging). Staging tables should only exist where there is a logical need for them.</p><h3>Utility Tables (Util)</h3><p>One of our use cases for utility tables is unusual mappings that we have between entities where we had to define the mapping logic on the data team side instead of having that mapping pre-defined in production data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=394d96369868" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dandy-engineering-blog/dandy-star-schema-394d96369868">Dandy Star Schema</a> was originally published in <a href="https://medium.com/dandy-engineering-blog">Dandy Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>