• v7.8.0
    • v7.11.0 (latest)
    • v7.10.0
    • v7.9.0
    • v7.8.0
    • v7.7.0
    • v7.6.0
    • v7.5.0
    • v7.3.0
    • v7.2.0
    • v7.1.1
    • v7.1.0
    • v7.0.8
  • Services & Support
  • Devo.com
  • Contact
    • Contact Us
    • Request a Demo
    • Partner Inquiry
  • Log In
    • USA Devo
    • EU Devo
PREVIOUS
Substitute all (subsall)
NEXT
Trim both sides (trim)

Searching data / Building a query / Operations reference / String group / Substring (substring)

Download as PDF

Substring (substring)

Description

Extracts a substring from a given string, indicating the position starting character. Optionally, you can indicate the length of the substrings. If the length is not specified, you will get all the characters from the starting point indicated.

How does it work in the search window?

Select Create column in the search window toolbar, then select the Substring operation. This operation needs at least two arguments:

ArgumentData typeMore information
Original string (mandatory)
string
Starting from character (mandatory)integerPosition of the starting character of the substrings.
Length of substringintegerThe number of characters you want your substrings to have. If not indicated, you will get all the characters from the starting point indicated.

The data type of the values in the new column is string.

Example

In the demo.eccomerce.data table, we want to get only the part indicating the month in our timestamp column. To do it, we will create a new column using the Substring operation. Let's call the new column substrings

The arguments needed to create the new column are:

  • Original string - timestamp column
  • Starting from character - 3
  • Length of substring - 3

Click Create column and you will see the following result:


How does it work in LINQ?

Use the operator select... as...  and add the operation syntax to create the new column. These are the valid formats of the Substring operation:

  • substring(string, starting_position_integer)

  • substring(string, starting_position_integer, length_integer)

Example

You can copy the following LINQ script and try the above example on the demo.ecommerce.data table. 

from demo.ecommerce.data
  select substring(timestamp, 3, 3) as substrings
Download as PDF

PREVIOUS
Substitute all (subsall)
NEXT
Trim both sides (trim)

Export

See what Devo can do for you. Request a demo!
Discover what's new (Release notes)
  • v7.8.0
    • v7.11.0 (latest)
    • v7.10.0
    • v7.9.0
    • v7.8.0
    • v7.7.0
    • v7.6.0
    • v7.5.0
    • v7.3.0
    • v7.2.0
    • v7.1.1
    • v7.1.0
    • v7.0.8
  • Services & Support
  • Devo.com
  • Contact
    • Contact Us
    • Request a Demo
    • Partner Inquiry
  • Log In
    • USA Devo
    • EU Devo
  • +1 888 6830910 (USA)
  • +34 900 838 880 (Spain)
Copyright © 2019 Legal Terms Privacy Policy Cookies Policy

Powered by Confluence and Scroll Viewport