The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
m_b_b_15
6 months agoNew Contributor III
Complex expression to remove currency symbols?
Hi all, we have a process to format data in the csv before it's imported into OneStream. This seems like extra work and I want to create a complex expression in the Data Source to remove this step. ...
- 6 months ago
Hi 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
sameburn
OneStream Employee
6 months 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
- 2 years ago
- 3 years ago