> ## Documentation Index
> Fetch the complete documentation index at: https://docs.less.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Operations

<AccordionGroup>
  <Accordion title="ROUND">
    Rounds a number to a specified number of decimal places. Can only be used on Decimal columns or expressions that return a decimal.

    <Frame caption="Rounding float_col to 1 decimal places">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/ROUND.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=de5558b1958ca5ce2492f9bfad046697" alt="ROUND function" width="1882" height="1244" data-path="images/canvas/syntax/operations/ROUND.png" />
    </Frame>
  </Accordion>

  <Accordion title="LEFT">
    Returns the leftmost n characters of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the leftmost 4 characters of date_string - i.e. the year">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/LEFT.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=bc9527bd452ce9f2719f531ac4ad9149" alt="LEFT function" width="1882" height="1244" data-path="images/canvas/syntax/operations/LEFT.png" />
    </Frame>
  </Accordion>

  <Accordion title="RIGHT">
    Returns the rightmost n characters of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the rightmost 8 characters of date_string - i.e. the timestamp">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/RIGHT.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=91d28f54493debb13875206c76e1bc14" alt="RIGHT function" width="1882" height="1244" data-path="images/canvas/syntax/operations/RIGHT.png" />
    </Frame>
  </Accordion>

  <Accordion title="SUBSTRING">
    Returns the substring of a string. Can only be used on String columns or expressions that return a string. A substring is a range of characters within a string.

    <Frame caption="Getting the substring of date_string from index 6 with a length of 2 - i.e. the month">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/SUBSTRING.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=227db1c1cba2a5412221f58a6f7cfc3b" alt="SUBSTRING function" width="1882" height="1244" data-path="images/canvas/syntax/operations/SUBSTRING.png" />
    </Frame>
  </Accordion>

  <Accordion title="LENGTH">
    Returns the length of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the length of string_col">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/LENGTH.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=7d00fb0d9f214aab8ab35bb31b1ebf95" alt="LENGTH function" width="1882" height="1244" data-path="images/canvas/syntax/operations/LENGTH.png" />
    </Frame>
  </Accordion>

  <Accordion title="DATEMATH">
    Adds or subtracts a number of days, weeks, months, etc to a datetime column. Can only be used on Datetime columns or expressions that return a date. The 'units' must be an integer. The unit can be:

    1. 'seconds'
    2. 'minutes'
    3. 'hours'
    4. 'days'
    5. 'weeks'
    6. 'months'
    7. 'years'

    <Frame caption="Adding the integer value of _simple_int column as days to date_string column after turning it into a datetime. You could also have added a static number (e.g. 10) of days instead of using the _simple_int column.">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/DATEMATH.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=fd1acbe980157635cbd464bf2b9ee86b" alt="DATEMATH function" width="1882" height="1244" data-path="images/canvas/syntax/operations/DATEMATH.png" />
    </Frame>
  </Accordion>

  <Accordion title="DATEDIFF">
    Get the difference in duration between two datetime columns or expressions that return a date. Can only be used on Datetime columns or expressions that return a date.
    The 'units' must be an integer. The unit can be:

    1. 'seconds'
    2. 'minutes'
    3. 'hours'
    4. 'days'
    5. 'weeks'

    <Frame caption="Getting the difference in days between a dynamic TODAY constant and the date_string after turning it into a datetime">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/DATEDIFF.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=c7222612d146cf17c4f4a650b2352178" alt="DATEDIFF function" width="1882" height="1244" data-path="images/canvas/syntax/operations/DATEDIFF.png" />
    </Frame>
  </Accordion>

  <Accordion title="DATETRUNC">
    Truncates a datetime column to a specified interval. Can only be used on Datetime columns or expressions that return a date. An example could be truncating to years which for 2025-08-01 would return 2025-01-01.

    <Frame caption="Truncating date_string to years after turning it into a datetime">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/DATETRUNC.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=dfe3e17d48153ca39a9e4510e0a99e80" alt="DATETRUNC function" width="1882" height="1244" data-path="images/canvas/syntax/operations/DATETRUNC.png" />
    </Frame>
  </Accordion>

  <Accordion title="UPPER">
    Returns the UPPERCASE of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the UPPERCASE of text_col">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/UPPER.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=df24655d6836519ee8a7c97fff37171d" alt="UPPER function" width="1882" height="1244" data-path="images/canvas/syntax/operations/UPPER.png" />
    </Frame>
  </Accordion>

  <Accordion title="LOWER">
    Returns the LOWERCASE of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the LOWERCASE of text_col">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/LOWER.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=013be33b3bd8f31a66c67f113b7bd78c" alt="LOWER function" width="1882" height="1244" data-path="images/canvas/syntax/operations/LOWER.png" />
    </Frame>
  </Accordion>

  <Accordion title="TITLE">
    Returns the title case of a string. Can only be used on String columns or expressions that return a string.

    <Frame caption="Getting the Titlecase of text_col">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/TITLE.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=1d57085af815376aac17e76c8addaac6" alt="TITLE function" width="1882" height="1184" data-path="images/canvas/syntax/operations/TITLE.png" />
    </Frame>
  </Accordion>

  <Accordion title="CONTAINS">
    Checks if a string literal exists in a string column or expression that returns a string. Returns a boolean (true or false).

    <Warning>
      This function is case-sensitive.
    </Warning>

    <Frame caption="Checking if the string literal 'google' exists in the regex_col column">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/CONTAINS.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=aa94fb6dd135e57007d8fb54b6d1c6f4" alt="CONTAINS function" width="1882" height="1244" data-path="images/canvas/syntax/operations/CONTAINS.png" />
    </Frame>
  </Accordion>

  <Accordion title="DOESNOTCONTAIN">
    Checks if a string literal does **not** exist in a string column or expression that returns a string. Returns a boolean (true or false).

    <Warning>
      This function is case-sensitive.
    </Warning>

    <Frame caption="Checking if the string literal 'google' does not exist in the regex_col column">
      <img src="https://mintcdn.com/less-51/djN6yMHrWL_J2lhR/images/canvas/syntax/operations/DOESNOTCONTAIN.png?fit=max&auto=format&n=djN6yMHrWL_J2lhR&q=85&s=154cc6ffb287b6fec60b073704fc9b3b" alt="DOESNOTCONTAIN function" width="1882" height="1244" data-path="images/canvas/syntax/operations/DOESNOTCONTAIN.png" />
    </Frame>
  </Accordion>
</AccordionGroup>
