This looks to me like you should run your stored procedure into a temporary table, then crosstable load this temporary table, so you have Date, Tag and Value columns, then you can just sum the Value.
The code would be something like:
CROSSTABLE (Tag, Value, 1) LOAD
DROP TABLE Temp_Data;
Once you have done this Tag is just a dimension and your expression is just Sum(Value) - regardless of the number of tags.
Hope that helps,