I had to dig up some old notes but here is the general gist of what I had to do to make this work:
- In addition to our 12 matrix time columns that come in as normal YYYYM1 – 12 we added a 13th matrix time column
- In this 13th column we had it come in as YYYYANNOTATION and then I made YYYYANNOTATION to YYYYM12 in mapping rules
- Then we had to add 2 parser business rules
- One we attached to the Amount matrix column in data source
- One we attached to the TextValue matrix annotation member column in data source
Namespace OneStream.BusinessRule.Parser.BR_MatrixAmount
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As ParserDimension, ByVal args As ParserArgs) As Object
Try
If API.DimensionDelimitedPosition = 27 Then 'look at 13th column which is year total column
globals.SetBoolValue("IncludeComment",True) 'set annotation global to true for only this column
api.ValueIsZeroSuppressed = False 'do not bypass zeros only on this 13th column
Return 0.00 'set amount in 13th column to 0.00
Else
globals.SetBoolValue("IncludeComment",False) 'set annotation global to false for all other columns so we only bring in comment to M12
Return args.Value 'leave all other amounts as-was
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Namespace OneStream.BusinessRule.Parser.BR_MatrixComment
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As ParserDimension, ByVal args As ParserArgs) As Object
Try
api.Parser.TextValueRowViewMember = "Annotation" 'pulls in textvalue column as annotation view member
If globals.GetBoolValue("IncludeComment",True) Then 'if comment column is true which is only true for 13th column
Return args.Value ' allow comment to pass through
Else
Return String.Empty 'otherwise if not 13th column then do not bring in comment annotation member
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Basically the end result is that we were able to manipulate the 13th column which I associated with only YYYYM12 to bring in a 0.00 amount only for columns in which the customer enters an annotation member. The combination of allowing a 0.00 to come in is what ultimately allows the comment to come in to T#YYYYM12:V#Annotation and without having to mock up a penny or something.
I will say that if I recall, this still brought in the commentary to all 12 months, but our issue was that it was not bringing in commentary to the 12th month if that month did not have an amount. So what we solved for was ultimately ensuring that all commentary was brought into M12 (even though it was also brought in for M1 - 11 which we did not need but lived with). I think. But it may also be that we got this to only bring in commentary to M12. I cannot recall 100% but the above is how we achieved this.