Trying a join of margins with history aggregates in probably the worst way possible