Forum Discussion
sameburn
OneStream Employee
2 hours agoHi m_b_b_15
Excel formulas won't work in a complex expression. However you can use string manipulation to extract what you need. Here is a simple example using substring that can get you started based on your description. You can add this to an Extensibility Rule in OneStream and click the Execute Extender button to see results (while you develop e.g. see screenshot below) and then migrate to your complex expression once happy with the results e.g.
Dim sb As New Text.StringBuilder
Dim input As String = "$3563.133"
sb.AppendLine($"Original Value ➡ {input}.")
Dim currency As String = input.Substring(0, 1)
sb.AppendLine($"Extracted Currency ➡ {currency}.")
Dim amount As Decimal = Decimal.Parse(input.Substring(1))
sb.AppendLine($"Extracted Amount ➡ {amount}.")
Throw New XFException(sb.ToString())
Hope this helps
Related Content
- 3 years ago
- 3 years ago
- 3 years ago