I've been working on analytics tools the past couple years and have explored ways to make calculations more consistent & reliable, especially in the age of LLMs. While I've also built a more traditional metric layer or semantic layer that I'll use in my project, I couldn't help implementing this pure SQL version (well, close to it) from a paper I read a couple years back.