Replies posted by jacopo.chiapparino
Depending on your database you could do this natively as well, for example with a function or extension. There are a few available in postgres which can allow you to type considerably less (this decrease mistakes): select weighted_average(price, quantity) from facts; This is especially useful if your team needs to use this type of calculations a lot around various Looker views. We use the same approach for medians and such. Bonus points if you also ship these to your warehouse with migrations and make them available to the rest of the users who query also closer to the db.
You’re doing the right thing George. You should write migrations for your native tables in your own migration manager (in this case CircleCI). Building PDTs on top of looker like in the suggestion above is not a good industry standard practice: the moment you will need to run those migrations internally against eg a new database (because you are migrating to some new stack) or your team may need a table to build a new data product, that table won’t be available. Being in control on how the data is materialized more upstream than your BI tool and leave the PDTs to analysts is a more future proof approach in our experience.
Already have an account? Login
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.