LogoLogo
2.3.1
2.3.1
  • Introduction
  • Getting started
    • Installation
      • On-premises
      • Azure Market Place
      • AWS Market Place
    • Concepts
      • Datadate
      • Datasets
      • Program directory
      • Home directory
      • RDFs
      • Accounts
      • Services
    • Configuration
      • Data Sources
        • Extractors
        • Transformers
      • Catalogue
        • Adjustments
        • Rates
        • Services
      • Administration
        • Configuration
        • Users Groups
        • Workflows
    • Tutorials
      • Amazon AWS CUR
      • Azure EA
      • Azure CSP
      • Azure Stack
    • Releases
      • Upgrading to version 2
      • Archive
  • Diving deeper
    • Extract
      • Templates
      • Script basics
      • Parslets
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • discard
        • encode
        • encrypt
        • escape
        • exit_loop
        • foreach
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • json
        • loglevel
        • loop
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uri
        • var
    • Transform
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • export
        • finish
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • service
        • services
        • set
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Report
      • Defining reports
      • Accounts
      • Services
      • Summary
    • Integrate
      • API docs
      • GUI automation
        • Examples
      • Single Sign On
        • Azure-AD
        • Auth0
Powered by GitBook
On this page
  • Overview
  • Syntax
  • Details
  • Example

Was this helpful?

Export as PDF
  1. Diving deeper
  2. Transform
  3. Language

convert

Overview

The convert statement is used to convert values in a column from base-10 to base-16 or vice-versa.

Syntax

convertcolNameto decimal|hex from decimal|hex

The keywords decanddecimaland the keywordshexandhexadecimalare equivalent.

Details

When converting values in a column, the following considerations apply:

  • Values in the column are replaced with the converted values

  • The colName argument must reference an existing column, and may optionally be fully qualified (else the column is assumed to be in the default DSET)

  • If any values in the column are not valid numbers, they will be treated as 0

  • Blank values are ignored

  • The convert statement may be used in the body of a where statement

  • If a value in colName contains a partially correct value such as 123xyz then it will be treated as a number up to the first invalid character, in this case resulting in a value of 123.

  • The hex digits in the original value can be either upper or lower case

  • The hex digits from A-F will be rendered in upper case in the converted output

  • The convert statement only supports integer values (floating points will be treated as floored to the nearest integer)

Example

convert decimal_count from decimal to hex
convert unique_id from hexadecimal to dec
PreviouscapitaliseNextcopy

Last updated 6 years ago

Was this helpful?