Hello,
asking you guys about some auto-calculation on 2 sets of notes
What I’m trying to do
I’ve got a folder of projects, each a note. Let’s call them P1, P2… P15
I also have a folder of indicators, each a note also. Say they are N1, N2, … N8.
Each indicator has its value, listed as property with a same name. [[N5]].value
Each project has one or several weights, each for one of the values. Currently they are organized as a list of maps in each project note:
valweights:
N3: 1
N10: 3
In a totally separate note I’ve got a Dataview table listing all of the projects as rows. I want to have a column, that for each project shows a “total weight” calculated by summing all weights for this project multiplied by the value of corresponding indicator:
total_weight_P4 = ([[P4]].valweights.N3*[[N3]].value + [[P4]].valweights.N10*[[N10]].value )
Things I have tried
I understand pretty clearly how I’d done this in Python - a couple of nested loops, or a matrix-on-vector multiplication if I feel a bit less dumb. But I’m not so keen in DQL, and can’t find the correct way to do this.
I suggest some funny application of “map” ought to do this, but can’t wrap my head over it, and I need this to get running sooner, even if hold together with duct tape until I sit to refactor it.
I’m just setting up the structure of this vault, so I can possibly rebuild how all these values are stored, if solution demands it.
I’m even ready to have the list of values-per-indicator as a precalculated constant inside the Dataview block or page.
Any hints would be appreciated