Additional Custom Functions

Created by Dariusz Szczendzina, Modified on Wed, 12 Jul, 2023 at 11:08 AM by Dariusz Szczendzina

This page details the additional custom functions available in DQ for Excel.

DQ.CASE_STRING

Cases a string.

Parameters:

input (string), text to case

caseType (string), type of case, from list:

  • ProperCase_FamilyName
  • ProperCase_Address
  • UpperCase
  • LowerCase
  • TitleCase

language (string), language of input, from list:

  • English
  • Spanish
  • French
  • Italian
  • German

returns (string), cased string

Examples:

inputcaseTypelanguageoutput
someTEXTuppercaseenglishSOMETEXT
someTEXTlowercaseenglishsometext

DQ.IS_ALL_UPPER

Checks if string is made up of only upper case characters.

Parameters:

input (string), text to check

returns (boolean), true if all upper case

inputoutput
SOMETEXTTRUE
someTEXTFALSE

DQ.IS_ALL_LOWER

Checks if a string is made up of only lower case characters

Parameters:

input (string), text to check

returns (boolean), true if all lower case

inputoutput
sometextTRUE
someTEXTFALSE

DQ.IS_MIXED_CASE

Checks if a string is made up of mixed case characters.

Parameters:

input (string), text to check

returns (boolean), true if mixed case

inputoutput
someTEXTTRUE
sometextFALSE

DQ.IS_ALPHA_NUMERIC

Checks if a string is made up of alpha numeric characters.

Parameters:

input (string), text to check

returns (boolean), true if alpha numeric

inputoutput
s0meT3XTTRUE
s!m?T3XTFALSE

DQ.IS_NUMERIC

Checks if a string is made up of numeric characters.

Parameters:

input (string), text to check

returns (boolean), true if numeric

inputoutput
12345678TRUE
someTEXTFALSE

DQ.IS_ISO4217_CURRENCY_CODE

Checks if a string is a ISO 4217 currency code. See ISO-4127-currency-codes for more information.

Parameters:

input (string), text to check

returns (boolean), true if ISO 4217 currency code

inputoutput
EURTRUE
EUROFALSE

DQ.IS_ISO2_CODE

Checks if a string is an ISO 3166-1 alpha-2 country code. See ISO 3166 country codes for more information.

Parameters:

input (string), text to check

returns (boolean), true if ISO2 code

inputoutput
GBTRUE
GBRFALSE

DQ.IS_ISO3_CODE

Checks if a string is an ISO 3166-1 alpha-3 country code. See ISO 3166 country codes for more information.

Parameters:

input (string), text to check

returns (boolean), true if ISO3 code

inputoutput
GBRTRUE
GBFALSE

DQ.REMOVE_LEADING

Removes a value from the start of a string.

Parameters:

input (string), text to modify

valueToRemove (string), value to remove from text

leaveOneAtStart (boolean), if true leave one occurrence at the start of the string

returns (string) modified text

inputvalueToRemoveleaveOneAtStartoutput
mymymymymyTestStringmyTRUEmyTestString
mymymymymyTestStringmyFALSETestString

DQ.REMOVE_CHARACTERS

Removes a type of character from a string.

Parameters:

input (string), text to modify

characterType (string), type of character, from list:

  • Digit
  • Letter
  • LetterOrDigit
  • Punctuation
  • Whitespace
  • Upper
  • Lower
  • Symbol
  • UpperCaseVowel
  • LowerCaseVowel
  • UpperCaseConsonant
  • LowerCaseConsonant
  • OddDigit
  • EvenDigit
  • NonPrinting

leaveOneAtStart (boolean), if true leave one occurrence at the start of the string

returns (string), modified text

inputcharacterTypeleaveOneAtStartoutput
Te123stDigitFALSETest
Te123stLetterFALSE123
Te12££stLetterOrDigitFALSE££
Te.stPunctuationFALSETest
Te stWhitespaceFALSETest
teEstUpper FALSETest
TEeSTLowerFALSETest
Te$$stSymbolFALSETest
TeEstUpperCaseVowelFALSETest
TeEstLowerCaseVowelFALSETEst
teTstUpperCaseConsonantFALSEtest
TetSTLowerCaseConsonantFALSETeST
Te1stOddDigitFALSETest
Te2stEvenDigitFALSETest
TestNonPrintingFALSETest

DQ.REMOVE_SINGLE_CHARACTER_WORDS

Removes single character words from a string.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
this is a very long string I thinkthis is very long string think

DQ.REPLACE_ADJACENT_REPEATING_TEXT

Replaces adjacent repeating text.

Parameters:

input (string), text to modify

repeatingValue (string), value to find and replace

replacement (string), replace value

returns (string), modified text

inputrepeatingValuereplacementoutput
exaaaaaaaample aababaaaa@exa@@@@@@@mple a@baba@@

DQ.REPLACE_IF_ENDS_WITH

Replaces a piece of text at the end of a string if found.

Parameters:

input (string), text to modify

repeatingValue (string), substring to replace, at the end of string

replacement (string), replace value

returns (string), modified text

inputrepeatingValuereplacementoutput
this is an inputput??this is an in??

DQ.REPLACE_IF_STARTS_WITH

Replaces a piece of text at the start of a string if found.

Parameters:

input (string), text to modify

repeatingValue (string), substring to replace, at the start of string

replacement (string), replace value

returns (string), modified text

inputrepeatingValuereplacementoutput
this is an inputth????is is an input

DQ.STRING_TO_BINARY

Converts a string to binary.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
test01110100011001010111001101110100

DQ.BINARY_TO_STRING

Converts a binary code into a string

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
01110100011001010111001101110100test

DQ.STRING_TO_HEX

Converts a string to hexadecimal.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
test74657374

DQ.HEX_TO_STRING

Converts a hexadecimal string to binary.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
74657374test

DQ.REVERSE

Reverse a given string.

Parameters:

input (string), text to reverse

returns (string), reversed text

inputoutput
myStringgnirtSym

DQ.NORMALIZE_WHITE_SPACE

Normalizes white space in a string by collapsing white space into single space characters.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
my—string—-with—-weird-white–spacemy string with weird white space

Note The values in the input column use dashes (-) to represent spaces.

DQ.NORMALIZE_ALPHA_NUMERIC_PHONE

Normalizes alpha numeric characters in a given phone number.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
1-800-flowers1-800-3569377

DQ.COLLAPSE_ADJACENT_REPEATED_CHARACTERS

Collapses adjacent repeated characters.

Parameters:

input (string), text to modify

collapseNumerics (boolean), true if numbers should be collapsed

maximumRepeat (number), the number of characters allowed before collapsing

returns (string), modified text

inputcollapseNumericsmaximumRepeatoutput
SillySily
Silly4455667777788890TRUESily4567890
Silly4455667777788890FALSESily4455667777788890
SilllllllyFALSE1Sillllllly
Sillllly5533669999TRUE2Sillllly5533669999

DQ.COLLAPSE_ADJACENT_REPEATED_TYPE

Collapses adjacent repeated types of character.

Parameters:

input (string), text to modify

maximumRepeat (number), the number of characters allowed before collapsing

type (string), type of character to check for, from list:

  • Letter
  • LowerCaseLetter
  • UpperCaseLetter
  • UpperCaseVowel
  • LowerCaseVowel
  • UpperCaseConsonant
  • LowerCaseConsonant
  • LetterOrNumber
  • Number
  • Punctuation
  • Whitespace
  • Symbol
  • NonPrinting

returns (string), modified text

inputcollapseNumericsmaximumRepeatoutput
TeeestTT1LetterTestT
TeeeestTT1LowerCaseLetterTestTT
TeeeestTT1UpperCaseLetterTeeeestT
TeeEEEstTT1UpperCaseVowelTeeEstTT
TeeEEEstTT1LowerCaseVowelTeEEEstTT
TeeEEEstTT1UpperCaseConsonantTeeEEEstT
TeeEEEssstTT1LowerCaseConsonantTeeEEEstTT
TeeEEst112233331LetterOrNumberTeEst123
TeeEEst112231NumberTeeEEst123
TeeEEstTT??..???1PunctuationTeeEEstTT?.?
Te EE stTT1WhitespaceTe EE stTT
Te£££st$$TT1SymbolTe£st$TT
TeeEest1NonPrintingTeeEest

DQ.FILTER_STOP_WORDS

Filters out stop words from a string.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
my noisy string with a lot of stop wordsnoisy string lot stop words

DQ.RETAIN_CHARACTERS

Retains given characters in a string, the remaining characters are replaced with the given replacement string.

Parameters:

input (string), text to modify

replacement (string), character to replace with

charactersToRetain (string), characters to not replace

returns (string), modified text

inputreplacementcharactersToRetainoutput
this is an input?i??i??i?????i????

DQ.EXTRACT_CHARACTERS

Extracts a given number of characters from the start or end of a string.

Parameters:

input (string), text to modify

extractLength (string), number of characters to extract

extractFrom (string), the point of the string to extract from, from list:

  • Start
  • End

returns (string), modified text

inputextractLengthextractFromoutput
myTestString3StartmyT
myTestString3Ending

DQ.EXTRACT_WORDS

Extracts number of words from a string.

Parameters:

input (string), text to modify

extractLength (string), number of words to extract

extractFrom (string), the point of the string to extract from, from list:

  • Start
  • End

returns (string), modified text

inputextractLengthextractFromoutput
my test string1Startmy
my test string2Endtest string

DQ.REMOVE_HTML

Removes HTML tags from a string.

Parameters:

input (string), text to modify

returns (string), modified text

inputoutput
Test <p id=myAttr>someText</p>Test someText

DQ.STARTS_WITH

Check if a string starts with a given value.

Parameters:

input (string), text to check

checkFor (string), value to check for

returns (boolean), true if starts with value

inputcheckForoutput
myStringmytrue
myStringmifalse

DQ.ENDS_WITH

Parameters:

input (string), text to check

checkFor (string), value to check for

returns (boolean), true if starts with value

inputcheckForoutput
myString123123true
myString123456false

DQ.ENSURE_ENDS_WITH

Ensure a string ends with a given value.

Parameters:

input (string), text to modify

suffix (string), value at the end of the string

returns (string), modified text

inputsuffixoutput
test_endStringendStringtest_endString
test_endStringtest_endString

DQ.ENSURE_STARTS_AND_ENDS_WITH

Ensures a string starts and ends with a given value.

Parameters:

input (string), text to modify

topAndTail (string), value to check for

returns (string), modified text

inputsuffixoutput
testString_test_testStringtestStringtestString_test_testString
_test_testStringtestString_test_testString

DQ.ENSURE_STARTS_WITH

Ensures a string starts with a given value.

Parameters:

input (string), text to modify

suffix (string), value at the start of the string

returns (string), modified text

inputsuffixoutput
startString_teststartStringstartString_test
_teststartStringstartString_test

DQ.STARTS_WITH_TYPE

Checks if a string starts with a given type of character.

Parameters:

input (string), text to check

type (string), type of value to check for, from list:

  • Letter
  • LowerCaseLetter
  • UpperCaseLetter
  • UpperCaseVowel
  • LowerCaseVowel
  • UpperCaseConsonant
  • LowerCaseConsonant
  • LetterOrNumber
  • Number
  • Punctuation
  • Whitespace
  • Symbol
  • NonPrinting

returns (boolean), true if found

inputtypeoutput
testLowerCaseLettertrue
TestUpperCaseLettertrue
EtestUpperCaseVoweltrue
eTestLowerCaseVoweltrue
TestUpperCaseConsonanttrue
testLowerCaseConsonanttrue
1testLetterOrNumbertrue
2testNumbertrue
.testPunctuationtrue
testWhitespacetrue
£testSymboltrue
testNonPrintingtrue

DQ.ENDS_WITH_TYPE

Checks if a string ends with a given type of character.

Parameters:

input (string), text to check

type (string), type of value to check for, from list:

  • Letter
  • LowerCaseLetter
  • UpperCaseLetter
  • UpperCaseVowel
  • LowerCaseVowel
  • UpperCaseConsonant
  • LowerCaseConsonant
  • LetterOrNumber
  • Number
  • Punctuation
  • Whitespace
  • Symbol
  • NonPrinting

returns (boolean), true if found

inputtypeoutput
testTLettertrue
testtLowerCaseLettertrue
testTUpperCaseLettertrue
testAUpperCaseVoweltrue
testaLowerCaseVoweltrue
testTUpperCaseConsonanttrue
testtLowerCaseConsonanttrue
testTLetterOrNumbertrue
test1Numbertrue
test.Punctuationtrue
testWhitespacetrue
test$Symboltrue
testNonPrintingtrue

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article