Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Returns the numbers contained in a string as a numeric value of appropriate type.

Syntax

Val(String_Expression)

Arguments

String_Expression

String that contains a number to be converted to a numeric value.

Examples

Val("9.56")

Above example will return 9.56. If the calculated member will have a formatting Integer then the display value will be 10.

Next example returns a numeric value from String Project Name that follows after -. So if the Project name is Demo-12, then the returned value will be 12.


Val(
 ExtractString([Project (Job)].CurrentMember.Name, 
 '.*-(\d+)', 1)
)

See also

Read more about ExtractString function that is used in the example.

Read here why it is suggested to use Val instead of StrToValue.

  • No labels