Skip to main content
July 15, 2025
Solved

Text field of Entity dimension in cube view

  • July 15, 2025
  • 4 replies
  • 0 views

Dear all,

Could you please advise how to show content of certain Text field of Entity dimension in cube view?

 

Best answer by BenEppel

Dear Ben,

Thank you! Am I right, that if tax rate is in Text2 field of Entity dimension, I need to change 1 to 2 in the nest string: api.Entity.Text(EntityID,2, False, False)?

I have another issue with this text field. It contains not only tax rate, but also text like this: CIT=15, VAT=0, so I need to take only number after text "CIT=" and before ",". In Excel I use function like this: SUBSTITUTE(LEFT(cell with Text2,FIND(",",cell with Text2)-1),"CIT=","")/100. Is it possible to extract tax rate in OneStream from text field too?


If your using text2 then you would need to change it. It is, you will just need logic to clean the string. Something like this should work.

Dim textVal As String = api.Entity.Text(EntityID, 1, False, False)
Dim taxRateStr As String = ""

If Not String.IsNullOrEmpty(textVal) Then
    Dim startIndex As Integer = textVal.IndexOf("CIT=")
    Dim endIndex As Integer = textVal.IndexOf(",", startIndex)

    If startIndex >= 0 AndAlso endIndex > startIndex Then
        taxRateStr = textVal.Substring(startIndex + 4, endIndex - (startIndex + 4))
    End If
End If

Dim TaxRate As Decimal = taxRateStr.XFConvertToDecimal() / 100D

 

4 replies

July 15, 2025

XFMemberProperty(DimType=Entity, Member=YourEntityMemberName, Property=Text1, VaryByScenarioType=[], VaryByTime=[])

IrinaAuthor
July 15, 2025

Dear BenEppel, thank you for your answer! Could you please advise is it possible to use text field in cube view not only as header (instead of entity name) but also use it for calculations. In text field I have income tax rate different for each entity and need to use each tax rate for calculation of income tax by entities. Could you also please advise can I also add entity name in the same report.

Employee
July 15, 2025

Hi Irina. I just want to confirm because it doesn't sound right. Are you saying you're storing the tax rate in the text property of an entity and want to use it to calculate something on the report?

IrinaAuthor
July 15, 2025

Hi Daniel,

Yes. You are right.

Employee
July 15, 2025

How come you're not just storing the rate in the cube and also putting your calculation on a member to use in your report (and elsewhere)?

IrinaAuthor
July 15, 2025

Daniel, do you mean that I can use certain UD dimension for tax rates storing?