SubString (PQL)

Returns a result string by extracting the characters between the two specified positions of a given string. 

  • Returned Output: Text
  • Library: PQL \ Common \ String
  • Version: 2018.00.000
  • Compatibility:
    • Can be combined with and other PQL function throughout the application.
    • It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.

Syntax

SubString( <Text> , <Start Integer> , <End Integer> )

* Click on the function's arguments above for more details on the input values.

Comments
  • The input text string can be any alphanumeric set of characters.
  • The start and end positions are integer numbers.
  • Counting starts from 0, with the start position (the first letter in the string) being 0.
  • The index is returned, not including the end position.

Examples

This example returns "pl" from the input string "apple" by taking the characters from positions 2 and 3:

SubString("apple",2,4)

In this example, "gin" is returned from the input string "original". The start and end positions are 3 and 6, so the characters from position 3 to position 5 are returned.

SubString("original",3,6)