01-17-2022
01:44 PM
- last edited on
05-02-2023
10:47 AM
by
JackLacava
SOURCE: ONESTREAM CHAMPIONS
Company has a hard carriage return in their file for a couple of description fields. They are struggling to fix it on their side. Is there code that can be written for the data source to remove this hard return and get everything on one line? Appreciate any guidance or snippet of cod
01-17-2022 01:44 PM
I don’t think you can. When the file comes in the column you are trying to fix is already in the second line. This needs to be done at the source. I cannot think of a different way to solve it.
01-17-2022 01:45 PM
Thanks Celvin! I tend to agree as that it is what I see when I look at the data in Notepad++ The line is already showing up in 3 separate lines within the data file. I will push back on the and try and get them to resolve on their side or determine that this field is not critical to bring into stage. Thanks, Mike
01-17-2022 01:45 PM
I had a similar problem at one point and had to remove a significant number of special characters (not all shown here). Try this in a Parser BR (sorry the tabs are not pasting in correctly):
Namespace OneStream.BusinessRule.Parser.Parse_Remove_Special_Characters
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As ParserDimension, ByVal args As ParserArgs) As Object
TryIf args.Value = "" Then Return "Empty_String" Else Return args.Value.Replace(vbCr, "").Replace(vbLf, "") End If Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End FunctionEnd Class
End Namespace
For the sake of anyone else that might read this later, you then attach this Business Rule to the dimension in the Data Source that you’re having issues with by selecting it as the Logical Operator/Expression.
01-17-2022 01:46 PM
Thanks for the suggestion Andy! I will give it a try and let you the group know.