Posts

Building Finance Open Item Reports: A SQL Stored Procedure Approach Building Finance Open Item Reports: A SQL Stored Procedure Approach Introduction Managing open items—such as accounts receivable and accounts payable—is fundamental to accurate financial reporting. Yet producing reliable open item reports for historical periods presents a significant technical challenge due to how SAP systems store this data. The Core Problem: Real-Time vs. Historical Data SAP's open item tables (BSIK for vendor open items, BSID for customer open items, and ACDOCA in S/4HANA) maintain current status in real-time. This means they always reflect open item status as of today , not as it existed at any historical point. When finance teams need to recreate what was open at month-end three months ago, the current table structure provides no direct path to that information. Why Manual Snapshots Fall Short Many or...

Flattening Hierarchical Data: Working with SAP SETNODE and SETLEAF

Flattening SAP Hierarchical Data for PowerBI Introduction Every once in a while we have to work with hierarchical data structures. In accounting, we have account hierarchies that looks like below: ACCT_ID PARENT_ACCT_ID 300000NS TIRPOPIN 310000NS 300000NS 311000NS 310000NS 312000NS 310000NS 320000NS 300000NS 321000NS 320000NS 322000NS 320000NS 322000NS_A ...

Building dbt Model Lineage in Python

Image
Building DBT Lineage: A Technical Deep Dive Introduction In the world of data engineering, dbt has become the de facto standard for transforming data in the warehouse. As a project grows from a handful of models to hundreds or even thousands, understanding the web of dependencies—the lineage—becomes critically important. While dbt docs provides a powerful visual graph, there are many scenarios where you need programmatic access to this lineage for advanced automation and analysis. This article will guide you through building a Python script to parse a dbt project, extract model dependencies from ref() functions, and construct a complete lineage file that you can use for powerful, automated analysis. The "Why": The Power of Programmatic Lineage Why do we need to go beyond the visual graph? Automated Impact Analysis : When you modify a core model, you n...