There are in excess of 100 custom functions built in to the framework.
Usage
Not all API’s support the use of custom functions. Those that support their use are:
API |
---|
Expert |
Transform |
XmlToJson Note: The namespace ado should be prefixed against each call to each function, e.g. ado:DateTimeParseExact |
The full glossary of all supported functions is listed below.
Concat / Concatenate
Concatenates exactly two strings together.
Parameter | Type | Description |
---|---|---|
value1 | String | First string to concatenate. |
value2 | String | Second string to concatenate. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.concat
Concat(Concat([Text1], ' '), [Text2])
Code language: JavaScript (javascript)
Input
[Text1] = This is
[Text2] = a test
Output
This is a test
Contains
Determines if one string contains another.
Parameter | Type | Description |
---|---|---|
value | String | To string to search within. |
searchFor | String | The string to search for. |
ignoreCase | Boolean | true = ignore the case sensitivity of the value.false = honour the case sensitivity of the value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.contains
Contains([Text], 'Test', true)
Code language: JavaScript (javascript)
Input
This is a test
Output
true
Code language: JavaScript (javascript)
EndsWith
Determines if a string ends with another string.
Parameter | Type | Description |
---|---|---|
value | String | To string to search within. |
searchFor | String | The string to search for. |
ignoreCase | Boolean | true = ignore the case sensitivity of the value.false = honour the case sensitivity of the value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.endswith
EndsWith([Text], 'Test', true)
Code language: JavaScript (javascript)
Input
This is a test
Output
true
Code language: JavaScript (javascript)
Format
Formats a number using syntax similar to that which is supported by Excel.
Parameter | Type | Description |
---|---|---|
value | Number | The value to format. |
format | String | Excel format string. Note: There is no guarantee that the framework will support all formats that work in Excel but testing has shown that the majority of the most common ones do. |
Example
Format([Value], '$#,##0.00')
Code language: JavaScript (javascript)
Input
10000.00
Code language: CSS (css)
Output
$10,000.00
Guid
Returns a new Guid.
Example
Guid()
Input
N/A
Output
f272d1a4-c69d-4830-90e8-d896a46a5fe5
Length
Returns the length of a string.
Parameter | Type | Description |
---|---|---|
value | String | To string to retrieve the length for. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.length
Length([Text])
Code language: CSS (css)
Input
This is a test
Output
14
Lower
Transforms the case of any given text to be all lower case.
Parameter | Type | Description |
---|---|---|
value | String | The text to transform to lower case. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.tolower
Lower([Text])
Code language: CSS (css)
Input
ThIs Is A tEsT
Output
this is a test
Code language: JavaScript (javascript)
Mid
Retrieves a substring from another string.
Parameter | Type | Description |
---|---|---|
value | String | To string to execute the replace function over. |
startIndex | Integer | The start position, 1 being the first. |
length | Integer | The amount of characters to return from the start index, 0 will continue to the end of the string. |
Example
Mid([Text], 10, 0)
Code language: CSS (css)
Input
This is a test
Output
test
PadLeft
Adds leading characters to a string.
Parameter | Type | Description |
---|---|---|
value | String | To string to add the leading characters to. |
paddingCharacter | Char | The character to add. |
totalWidth | Integer | The total width the result should be after the leading characters have been added. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.padleft
PadLeft([Text], '0', 10)
Code language: JavaScript (javascript)
Input
1000
Output
0000001000
PadRight
Adds trailing characters to a string.
Parameter | Type | Description |
---|---|---|
value | String | To string to add the trailing characters to. |
paddingCharacter | Char | The character to add. |
totalWidth | Integer | The total width the result should be after the trailing characters have been added. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.padright
PadRight([Text], '0', 10)
Code language: JavaScript (javascript)
Input
0001
Output
0001000000
Proper
Will set the text for any given string to “proper” case.
Parameter | Type | Description |
---|---|---|
value | String | The text to make “proper”. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.globalization.textinfo.totitlecase
Proper([Text])
Code language: CSS (css)
Input
this is a test
Code language: JavaScript (javascript)
Output
This Is A Test
RemoveLeadingZeros
Removes the leading zeros of the value provided.
Parameter | Type | Description |
---|---|---|
value | String | The value to remove the leading zeros from. |
Example
RemoveLeadingZeros([CostCenter])
Code language: CSS (css)
Input
0000001000
Output
1000
RegexCount
Returns the amount of occurrences a regex pattern matches a string.
Parameter | Type | Description |
---|---|---|
value | String | To string to execute the regular expression over. |
pattern | String | The regex pattern. Note: Passing regex statements through JSON requires that it be properly encoded, therefore, this property accepts either the pattern base64 encoded, or the pattern itself. |
Notes
Regex patterns are able to be passed as a base64 string or as a plain text encoded string that is acceptable to the JSON format.
The base64 string passed in as the pattern, when decoded, equals …
^[\w-.]+@([\w-]+.)+[\w-]{2,4}$
… if the string weren’t base64 encoded, then it would need to be encoded for JSON and therefore, look like this …
^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$
Different regex expressions will require various amounts of complexity when encoding but the framework does allow for both approaches which provides you with options when using this function.
Example
The example below is taken directly from the Microsoft documentation. Please refer to this link for more information and more examples.
https://docs.microsoft.com/en-us/dotnet/standard/base-types/quantifiers-in-regular-expressions
RegexCount([Text], '\\b91*9*\\b')
Code language: JavaScript (javascript)
Input
99 95 919 929 9119 9219 999 9919 91119
Output
5
RegexMatch
Determines if a string matches the regex pattern supplied.
Parameter | Type | Description |
---|---|---|
value | String | To string to execute the regular expression over. |
pattern | String | The regex pattern. Note: Passing regex statements through JSON requires that it be properly encoded, therefore, this property accepts either the pattern base64 encoded, or the pattern itself. |
Notes
Regex patterns are able to be passed as a base64 string or as a plain text encoded string that is acceptable to the JSON format.
The base64 string passed in as the pattern, when decoded, equals …
^[\w-.]+@([\w-]+.)+[\w-]{2,4}$
… if the string weren’t base64 encoded, then it would need to be encoded for JSON and therefore, look like this …
^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$
Different regex expressions will require various amounts of complexity when encoding but the framework does allow for both approaches which provides you with options when using this function.
Example
This example demonstrates a regex pattern checking to ensure an email address matches the generic structure expected (i.e. no space, @ symbol, .com etc.)
RegexMatch([Text], 'Xltcdy1cLl0rQChbXHctXStcLikrW1x3LV17Miw0fSQ=')
Code language: JavaScript (javascript)
Input
support@statesolutions.com.au
Code language: CSS (css)
Output
True
Code language: PHP (php)
RegexReplace
Replaces all occurrences of the regex pattern results with a replacement string.
Parameter | Type | Description |
---|---|---|
value | String | To string to execute the regular expression over. |
pattern | String | The regex pattern. Note: Passing regex statements through JSON requires that it be properly encoded, therefore, this property accepts either the pattern base64 encoded, or the pattern itself. |
replaceWith | String | The replacement string. |
Notes
Regex patterns are able to be passed as a base64 string or as a plain text encoded string that is acceptable to the JSON format.
The base64 string passed in as the pattern, when decoded, equals …
^[\w-.]+@([\w-]+.)+[\w-]{2,4}$
… if the string weren’t base64 encoded, then it would need to be encoded for JSON and therefore, look like this …
^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$
Different regex expressions will require various amounts of complexity when encoding but the framework does allow for both approaches which provides you with options when using this function.
Example
This example demonstrates a regex pattern that replaces all characters that are not numeric or alpha with a hyphen.
RegexReplace([Text], '[^0-9a-zA-Z]+', '-')
Code language: JavaScript (javascript)
Input
Replace all special . characters @ with a hyphen*
Code language: JavaScript (javascript)
Output
Replace-all-special-characters-with-a-hyphen-
Code language: JavaScript (javascript)
Replace
Replaces all occurrences of text within a string, with another string.
Parameter | Type | Description |
---|---|---|
value | String | To string to execute the replace function over. |
oldValue | String | The value to replace. |
newValue | String | The value that oldValue will be replaced with. |
ignoreCase | Boolean | true = ignore the case sensitivity of the value.false = honour the case sensitivity of the value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.replace
Replace([Text], ' a ', ' a successful ', true)
Code language: JavaScript (javascript)
Input
This is a test
Output
This is a successful test
Reverse
Reverses a string.
Parameter | Type | Description |
---|---|---|
value | String | The text to reverse. |
Example
Reverse([Text])
Code language: CSS (css)
Input
This is a test
Output
tset a si sihT
StartsWith
Determines if a string starts with another string.
Parameter | Type | Description |
---|---|---|
value | String | To string to search within. |
searchFor | String | The string to search for. |
ignoreCase | Boolean | true = ignore the case sensitivity of the value.false = honour the case sensitivity of the value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.startswith
StartsWith([Text], 'This', true)
Code language: JavaScript (javascript)
Input
This is a test
Output
true
Code language: JavaScript (javascript)
Trim
Trims all leading and trailing spaces.
Parameter | Type | Description |
---|---|---|
value | String | The text to trim. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.trim
Trim([Text])
Code language: CSS (css)
Input (quotes encapsulated to show start and end of text)
" Test "
Code language: JSON / JSON with Comments (json)
Output (quotes encapsulated to show start and end of text)
"Test"
Code language: JSON / JSON with Comments (json)
TrimEnd
Trims all trailing spaces.
Parameter | Type | Description |
---|---|---|
value | String | The text to trim. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.trimend
TrimEnd([Text])
Code language: CSS (css)
Input (quotes encapsulated to show start and end of text)
" Test "
Code language: JSON / JSON with Comments (json)
Output (quotes encapsulated to show start and end of text)
" Test"
Code language: JSON / JSON with Comments (json)
TrimStart
Trims all leading spaces.
Parameter | Type | Description |
---|---|---|
value | String | The text to trim. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.trimstart
TrimStart([Text])
Code language: CSS (css)
Input (quotes encapsulated to show start and end of text)
" Test "
Code language: JSON / JSON with Comments (json)
Output (quotes encapsulated to show start and end of text)
"Test "
Code language: JSON / JSON with Comments (json)
Upper
Transforms the case of any given text to be all upper case.
Parameter | Type | Description |
---|---|---|
value | String | The text to transform to upper case. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.string.toupper
Upper([Text])
Code language: CSS (css)
Input
ThIs Is A tEsT
Output
THIS IS A TEST
Abs
Returns the absolute value of a decimal number.
Parameter | Type | Description |
---|---|---|
value | Double | Numeric value |
Example
The framework will return a string, therefore, you will need to encapsulate the function with a numeric conversion function to ensure it’s returned as a true number and not a string.
https://docs.microsoft.com/en-us/dotnet/api/system.math.abs
Abs([Value])
Code language: CSS (css)
Input
-12.34
Code language: CSS (css)
Output
12.34
Code language: CSS (css)
Acos
Returns the angle whose cosine is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.acos
Acos([Value])
Code language: CSS (css)
Input
0.6
Code language: CSS (css)
Output
0.9272952
Code language: CSS (css)
Acosh
Returns the angle whose hyperbolic cosine is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a hyperbolic cosine, where value must be greater than or equal to 1, but less than or equal to PositiveInfinity. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.acosh
Acosh([Value])
Code language: CSS (css)
Input
10
Output
2.993223
Code language: CSS (css)
Asin
Returns the angle whose sine is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a sine, where value must be greater than or equal to -1, but less than or equal to 1. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.asin
Asin([Value])
Code language: CSS (css)
Input
0.6
Code language: CSS (css)
Output
0.6435011
Code language: CSS (css)
Asinh
Returns the angle whose hyperbolic sine is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a hyperbolic sine, where value must be greater than or equal to NegativeInfinity, but less than or equal to PositiveInfinity. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.asinh
Asinh([Value])
Code language: CSS (css)
Input
0.6
Code language: CSS (css)
Output
0.5688249
Code language: CSS (css)
Atan
Returns the angle whose tangent is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a tangent. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.atan
Atan([Value])
Code language: CSS (css)
Input
0.6
Code language: CSS (css)
Output
0.5404195
Code language: CSS (css)
Atan2
Returns the angle whose tangent is the quotient of two specified numbers.
Parameter | Type | Description |
---|---|---|
y | Double | The y coordinate of a point. |
x | Double | The x coordinate of a point. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.atan2
Atan2([y], [x])
Code language: CSS (css)
Input
y = 0.2
x = 0.8
Output
0.24497867
Code language: CSS (css)
Atanh
Returns the angle whose hyperbolic tangent is the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number representing a hyperbolic tangent, where value must be greater than or equal to -1, but less than or equal to 1. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.atanh
Atanh([Value])
Code language: CSS (css)
Input
0.6
Code language: CSS (css)
Output
0.6931472
Code language: CSS (css)
BigMul
Produces the full product of two 32-bit numbers.
Parameter | Type | Description |
---|---|---|
a | Integer | The first number to multiply. |
b | Integer | The second number to multiply. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.bigmul
BigMul([a], [b])
Code language: CSS (css)
Input
a = 10
b = 20
Output
200
Cbrt
Returns the cube root of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose cube root is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.cbrt
Cbrt([Value])
Code language: CSS (css)
Input
100
Output
4.6415887
Code language: CSS (css)
Ceiling
Returns the smallest integral value greater than or equal to the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | Numeric value |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.ceiling
Ceiling([Value])
Code language: CSS (css)
Input
1.23
Code language: CSS (css)
Output
2.0
Code language: CSS (css)
CopySign
Returns a value with the magnitude of x
and the sign of y
.
Parameter | Type | Description |
---|---|---|
x | Double | A number whose magnitude is used in the result. |
y | Double | A number whose sign is the used in the result. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.copysign
CopySign([x], [y])
Code language: CSS (css)
Input
x = -10
y = 20
Output
10
Cos
Returns the cosine of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.cos
Cos([Value])
Code language: CSS (css)
Input
10
Output
-0.8390715
Code language: CSS (css)
Cosh
Returns the cosine of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.cosh
Cos([Value])
Code language: CSS (css)
Input
10
Output
-0.8390715
Code language: CSS (css)
E
Represents the natural logarithmic base, specified by the constant, e
.
Example
E()
Input
N/A
Output
2.71828182845904
Code language: CSS (css)
Exp
Returns the cosine of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | A number specifying a power. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.exp
Exp([Value])
Code language: CSS (css)
Input
1
Output
2.7182817
Code language: CSS (css)
Floor
Returns the largest integral value less than or equal to the specified number.
Parameter | Type | Description |
---|---|---|
value | Double | Numeric value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.floor
Floor([Value])
Code language: CSS (css)
Input
1.23
Code language: CSS (css)
Output
1.0
Code language: CSS (css)
FusedMultiplyAdd
Returns (x * y) + z, rounded as one ternary operation.
Parameter | Type | Description |
---|---|---|
x | Double | The number to be multiplied with y |
y | Double | The number to be multiplied with x . |
z | Double | The number to be added to the result of x multiplied by y . |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.fusedmultiplyadd
FusedMultiplyAdd([x], [y], [z])
Code language: CSS (css)
Input
x = 5
y = 6
z = 17
Output
47.0
Code language: CSS (css)
ILogB
Returns the base 2 integer logarithm of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose logarithm is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.ilogb
ILogB([Value])
Code language: CSS (css)
Input
10
Output
3
Log
Returns the natural (base e
) logarithm of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose logarithm is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.log
Log([Value])
Code language: CSS (css)
Input
10
Output
2.3025851
Code language: CSS (css)
Log10
Returns the base 10 logarithm of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number whose logarithm is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.log10
Log10([Value])
Code language: CSS (css)
Input
100
Output
2.0
Code language: CSS (css)
Log2
Returns the base 2 logarithm of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | A number whose logarithm is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.log2
Log2([Value])
Code language: CSS (css)
Input
100
Output
6.643856
Code language: CSS (css)
Max
Returns the larger of two double-precision floating-point numbers.
Parameter | Type | Description |
---|---|---|
value1 | Double | The first of two double-precision floating-point numbers to compare. |
value2 | Double | The second of two double-precision floating-point numbers to compare. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.max
Max([Value1], [Value2])
Code language: CSS (css)
Input
Value1 = 20
Value2 = 10
Output
20
MaxMagnitude
Returns the larger magnitude of two double-precision floating-point numbers.
Parameter | Type | Description |
---|---|---|
value1 | Double | The first of two double-precision floating-point numbers to compare. |
value2 | Double | The second of two double-precision floating-point numbers to compare. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.maxmagnitude
MaxMagnitude([Value1], [Value2])
Code language: CSS (css)
Input
Value1 = 20
Value2 = 10
Output
20.0
Code language: CSS (css)
Min
Returns the smaller of two double-precision floating-point numbers.
Parameter | Type | Description |
---|---|---|
value1 | Double | The first of two double-precision floating-point numbers to compare. |
value2 | Double | The second of two double-precision floating-point numbers to compare. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.min
Min([Value1], [Value2])
Code language: CSS (css)
Input
Value1 = 20
Value2 = 10
Output
10
MinMagnitude
Returns the smaller magnitude of two double-precision floating-point numbers.
Parameter | Type | Description |
---|---|---|
value1 | Double | The first of two double-precision floating-point numbers to compare. |
value2 | Double | The second of two double-precision floating-point numbers to compare. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.minmagnitude
MinMagnitude([Value1], [Value2])
Code language: CSS (css)
Input
Value1 = 20
Value2 = 10
Output
10.0
Code language: CSS (css)
Pi
Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.
Example
Pi()
Input
N/A
Output
3.14159265358979
Code language: CSS (css)
Pow
Returns a specified number raised to the specified power.
Parameter | Type | Description |
---|---|---|
x | Double | A double-precision floating-point number to be raised to a power. |
y | Double | A double-precision floating-point number that specifies a power. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.pow
Pow([x], [y])
Code language: CSS (css)
Input
Value1 = 3
Value2 = 5
Output
243.0
Code language: CSS (css)
ReciprocalEstimate
Returns an estimate of the reciprocal of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose reciprocal is to be estimated. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.reciprocalestimate
ReciprocalEstimate([value])
Code language: CSS (css)
Input
5
Output
0.2
Code language: CSS (css)
ReciprocalSqrtEstimate
Returns an estimate of the reciprocal square root of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose reciprocal square root is to be estimated. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.reciprocalsqrtestimate
ReciprocalSqrtEstimate([value])
Code language: CSS (css)
Input
5
Output
0.447213595499958
Code language: CSS (css)
Round
Rounds a value to the nearest integer or to the specified number of fractional digits.
Parameter | Type | Description |
---|---|---|
value | Double | A decimal number to be rounded. |
decimals | Integer | The number of decimal places in the return value. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.round
Round([value], [decimals])
Code language: CSS (css)
Input
Value = 5.36752
Decimals = 2
Output
5.37
Code language: CSS (css)
ScaleB
Returns x * 2^n computed efficiently.
Parameter | Type | Description |
---|---|---|
x | Double | A double-precision floating-point number that specifies the base value. |
n | Integer | A 32-bit integer that specifies the power. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.scaleb
ScaleB([x], [n])
Code language: CSS (css)
Input
x = 5.45
n = 2
Output
21.8
Code language: CSS (css)
Sign
Returns an integer that indicates the sign of a number.
Parameter | Type | Description |
---|---|---|
value | Double | A signed number. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.sign
Sign([Value])
Code language: CSS (css)
Input
-1.23
Code language: CSS (css)
Output
-1
Sin
Returns the sine of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.sin
Sin([Value])
Code language: CSS (css)
Input
1.45
Code language: CSS (css)
Output
0.992712991037589
Code language: CSS (css)
Sinh
Returns the hyperbolic sine of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.sinh
Sinh([Value])
Code language: CSS (css)
Input
1.45
Code language: CSS (css)
Output
2.01427211353751
Code language: CSS (css)
Sqrt
Returns the square root of a specified number.
Parameter | Type | Description |
---|---|---|
value | Double | The number whose square root is to be found. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.sqrt
Sqrt([Value])
Code language: CSS (css)
Input
10
Output
3.16227766016838
Code language: CSS (css)
Tan
Returns the tangent of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.tan
Tan([Value])
Code language: CSS (css)
Input
10
Output
0.648360827459087
Code language: CSS (css)
Tanh
Returns the hyperbolic tangent of the specified angle.
Parameter | Type | Description |
---|---|---|
value | Double | An angle, measured in radians. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.tanh
Tanh([Value])
Code language: CSS (css)
Input
10
Output
0.999999995877693
Code language: CSS (css)
Tau
Represents the number of radians in one turn, specified by the constant, τ.
Example
Tau()
Input
N/A
Output
6.28318530717959
Code language: CSS (css)
Truncate
Calculates the integral part of a number.
Parameter | Type | Description |
---|---|---|
value | Double | A number to truncate. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.math.truncate
Truncate([Value])
Code language: CSS (css)
Input
1.23456789
Code language: CSS (css)
Output
1.0
Code language: CSS (css)
AddTime
Returns a new DateTime that adds the value of the specified time to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the time to. |
time | String | Hours, minutes, seconds. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.add
AddTime([Date], [Time])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Time] = 16:43:28
Code language: JavaScript (javascript)
Output
2022-01-14 16:43:28
Code language: CSS (css)
AddTicks
Returns a new DateTime that adds the specified number of ticks to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
ticks | Long | A number of 100-nanosecond ticks. The value parameter can be positive or negative. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addticks
AddTicks([Date], [Ticks])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Ticks] = 1234567890
Code language: JavaScript (javascript)
Output
2022-01-14 00:02:03.456789
Code language: CSS (css)
AddMilliseconds
Returns a new DateTime that adds the specified number of milliseconds to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
milliseconds | Double | A number of whole and fractional milliseconds. The parameter can be negative or positive. Note that this value is rounded to the nearest integer. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addmilliseconds
AddMilliseconds([Date], [Milliseconds])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Milliseconds] = 12345678
Code language: JavaScript (javascript)
Output
2022-01-14 03:25:45.678
Code language: CSS (css)
AddSeconds
Returns a new DateTime that adds the specified number of seconds to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
seconds | Double | A number of whole and fractional seconds. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addseconds
AddSeconds([Date], [Seconds])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Seconds] = 123456
Code language: JavaScript (javascript)
Output
2022-01-15 10:17:36
Code language: CSS (css)
AddMinutes
Returns a new DateTime that adds the specified number of minutes to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
minutes | Double | A number of whole and fractional minutes. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addminutes
AddMinutes([Date], [Minutes])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Minutes] = 1234
Code language: JavaScript (javascript)
Output
2022-01-14 20:34:00
Code language: CSS (css)
AddHours
Returns a new DateTime that adds the specified number of hours to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
hours | Double | A number of whole and fractional hours. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addhours
AddHours([Date], [Hours])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Hours] = 12.5
Code language: JavaScript (javascript)
Output
2022-01-14 12:30:00
Code language: CSS (css)
AddDays
Returns a new DateTime that adds the specified number of days to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
days | Double | A number of whole and fractional days. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.adddays
AddDays([Date], [Days])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Days] = 1.7
Code language: JavaScript (javascript)
Output
2022-01-15 16:48:00
Code language: CSS (css)
AddMonths
Returns a new DateTime that adds the specified number of months to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
months | int | A number of months. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addmonths
AddMonths([Date], [Months])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Months] = 1
Code language: JavaScript (javascript)
Output
2022-02-14 00:00:00
Code language: CSS (css)
AddYears
Returns a new DateTime that adds the specified number of years to the value of this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to add the ticks to. |
years | int | A number of years. The parameter can be negative or positive. |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.addyears
AddYears([Date], [Months])
Code language: CSS (css)
Input
[Date] = 14-Jan-2022
[Years] = 1
Code language: JavaScript (javascript)
Output
2023-01-14 00:00:00
Code language: CSS (css)
Ticks
Gets the ticks represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to get the value for. |
Example
Ticks([Date])
Code language: JavaScript (javascript)
Input
14-March-2022 16:34:26.382
Code language: CSS (css)
Output
637828724663820000
Millisecond
Gets the millisecond represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to get the value for. |
Example
Millisecond([Date])
Code language: JavaScript (javascript)
Input
14-March-2022 16:34:26.382
Code language: CSS (css)
Output
382
Second
Gets the second represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to get the value for. |
Example
Second([Date])
Code language: JavaScript (javascript)
Input
14-March-2022 16:34:26
Code language: CSS (css)
Output
26
Minute
Gets the minute represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to get the value for. |
Example
Minute([Date])
Code language: JavaScript (javascript)
Input
14-March-2022 16:34:26
Code language: CSS (css)
Output
34
Hour
Gets the hour represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to get the value for. |
Example
Hour([Date])
Code language: JavaScript (javascript)
Input
14-March-2022 16:34:26
Code language: CSS (css)
Output
16
Day
Gets the day of the month represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to get the value for. |
Example
Day([Date])
Code language: JavaScript (javascript)
Input
14-Jan-2022
Output
14
DayOfWeek
Gets the day of the week represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to get the value for. |
Example
DayOfWeek([Date])
Code language: JavaScript (javascript)
Input
14-Jan-2022
Output
5
DayOfYear
Gets the day of the year represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to get the value for. |
Example
DayOfYear([Date])
Code language: JavaScript (javascript)
Input
14-March-2022
Output
73
Month
Gets the month represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to get the value for. |
Example
Month([Date])
Code language: JavaScript (javascript)
Input
14-Jan-2022
Output
1
Year
Gets the year represented by this instance.
Parameter | Type | Description |
---|---|---|
date | Date | The date to get the value for. |
Example
Year([Date])
Code language: JavaScript (javascript)
Input
14-Jan-2022
Output
2022
Epoch
Returns the current date and time in Unix epoch format (i.e. the number of seconds that have expired since January 1, 1970).
Example
Epoch()
Input
N/A
Output
1657192585
EpochToDateTime
Adds leading characters to a string.
Parameter | Type | Description |
---|---|---|
epoch | Long | Epoch (i.e. the number of seconds that have expired since January 1, 1970). |
Example
EpochToDateTime([Epoch])
Code language: CSS (css)
Input
1657192585
Output
2022-07-07 11:16:25
Code language: CSS (css)
FormatDateTime
Formats a DateTime value to the desired string value.
Parameter | Type | Description |
---|---|---|
date | DateTime | The date/time to format. |
format | String | Format string. |
Example
FormatDateTime([Date], [Format])
Code language: CSS (css)
Input
[Date] = UtcNow()
[Format] = dd-MMM yyyy, hh:ss
Code language: JavaScript (javascript)
Output
07-July 2022, 11:42
Code language: CSS (css)
UtcNow
Gets a DateTime object that is set to the current date, expressed as the Coordinated Universal Time (UTC).
Example
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.utcnow
UtcNow()
Input
N/A
Output
2022-07-07 11:25:57.7045237
Code language: CSS (css)
ConvertTimeFromUtc
Converts a Coordinated Universal Time (UTC) to the time in a specified time zone.
Parameter | Type | Description |
---|---|---|
date | String | To string to add the leading characters to. |
timeZone | String | The timezone the date parameter is from |
Example
https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.converttimefromutc
The values permitted for the timeZone
parameter can be found by executing this block of code …
using System;
public class Program
{
public static void Main()
{
foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones())
{
Console.WriteLine(timeZoneInfo.DisplayName);
Console.WriteLine(timeZoneInfo.StandardName);
Console.WriteLine("");
}
}
}
Code language: PHP (php)
… at .NET Fiddle (https://dotnetfiddle.net/).
The following link will produce the output directly without you needing to copy and paste the code … https://dotnetfiddle.net/Widget/Mt6GOc
ConvertTimeFromUtc([Date], [TimeZone])
Code language: CSS (css)
Input
[Date] = [UtcNow]
[TimeZone] = 'E. Australia Standard Time'
Code language: JavaScript (javascript)
Output
2022-07-07 21:40:22.0990313
Code language: CSS (css)
FromWindowsFileTime
Converts a Windows File Time value to a date time.
Parameter | Type | Description |
---|---|---|
fileTime | Long | The Windows File Time value to convert. |
https://learn.microsoft.com/en-us/dotnet/api/system.datetime.fromfiletime
FromWindowsFileTime([fileTime])
Code language: CSS (css)
Input
[fileTime] = 133197984000000000
Output
2023-02-02T08:00:00+00:00
Code language: CSS (css)
String
Returns a string that represents the current object.
Parameter | Type | Description |
---|---|---|
value | Dynamic | Any value that can be converted to a string. |
Example
String([Value])
Code language: JavaScript (javascript)
Input
123.45
Code language: CSS (css)
Output
"123.45"
Code language: JSON / JSON with Comments (json)
Bool / Boolean
Converts the specified string representation of a logical value to its Boolean equivalent (i.e. true
or false
).
Parameter | Type | Description |
---|---|---|
value | Dynamic | A string containing the value to convert (i.e. “true”, 1, 0, “False”, “false”, “True) |
Example
Bool([Value])
Code language: CSS (css)
Input
1
Output
true
Code language: JavaScript (javascript)
DateTime
Converts the string representation of a date and time to its DateTime equivalent by using the conventions of the current culture.
Parameter | Type | Description |
---|---|---|
value | String | A string that contains a date and time to convert. |
Example
DateTime([Value])
Code language: CSS (css)
Input
14-March-2022 16:34:26.382
Code language: CSS (css)
Output
2022-03-14 16:34:26.382
Code language: CSS (css)
DateTimeParseExact
Converts the string representation of a date and time to its DateTime equivalent. The format of the string representation must match a specified format exactly or an exception is thrown.
Parameter | Type | Description |
---|---|---|
value | String | A string that contains a date and time to convert. |
format | String | A format specifier that defines the required format of the value. |
Example
DateTimeParseExact([Value], [Format])
Code language: CSS (css)
Input
Value = 20220531
Format = yyyyMMdd
Output
2021-07-31 00:00:00
Code language: CSS (css)
DateSerial
Returns a date for a specified year, month, and day.
Parameter | Type | Description |
---|---|---|
year | Integer | Year |
month | Integer | Month |
day | Integer | Day |
Example
DateSerial([Year], [Month], [Day])
Code language: CSS (css)
Input
Year = 2022
Month = 2
Day = 14
Output
2022-02-14 00:00:00
Code language: CSS (css)
Double
Converts the string representation of a number to its double-precision floating-point number equivalent.
Parameter | Type | Description |
---|---|---|
value | String | A string that contains a number to convert. |
Example
Double([Value])
Code language: CSS (css)
Input
"1.23"
Code language: JSON / JSON with Comments (json)
Output
1.23
Code language: CSS (css)
Float
Converts the string representation of a number to its floating-point number equivalent.
Parameter | Type | Description |
---|---|---|
value | String | A string that contains a number to convert. |
Example
Float([Value])
Code language: CSS (css)
Input
"1.23"
Code language: JSON / JSON with Comments (json)
Output
1.23000001907349
Code language: CSS (css)
In / Integer
Converts the string representation of a number to its 32-bit signed integer equivalent.
Parameter | Type | Description |
---|---|---|
value | String | A string containing a number to convert. |
Example
Int([Value])
Code language: CSS (css)
Input
"123"
Code language: JSON / JSON with Comments (json)
Output
123
Long
Converts the string representation of a number to its 64-bit signed integer equivalent.
Parameter | Type | Description |
---|---|---|
value | String | A string containing a number to convert. |
Example
Long([Value])
Code language: CSS (css)
Input
"123456789012345"
Code language: JSON / JSON with Comments (json)
Output
123456789012345
Base64Encode
Converts a raw string to its equivalent string representation that is encoded with base-64 digits.
Parameter | Type | Description |
---|---|---|
value | String | A string containing a the values to encode. |
Example
Base64Encode([Value])
Code language: CSS (css)
Input
This is a test
Output
VGhpcyBpcyBhIHRlc3Q=
Base64Decode
Converts a string encoded with base-64 digits to its equivalent string representation.
Parameter | Type | Description |
---|---|---|
value | String | A string containing a the values to decode. |
Example
Base64Decode([Value])
Code language: CSS (css)
Input
VGhpcyBpcyBhIHRlc3Q=
Output
This is a test
CelsiusToFahrenheit
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in Celsius to convert to Fahrenheit |
Example
CelsiusToFahrenheit([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
105.54
Code language: CSS (css)
CelsiusToKelvin
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in Celsius to convert to Kelvin |
Example
CelsiusToKelvin([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
313.45
Code language: CSS (css)
KelvinToCelsius
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in Kelvin to convert to Celsius. |
Example
KelvinToCelsius([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
-232.85
Code language: CSS (css)
MilesToMeters
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in miles to convert to meters. |
Example
MilesToMeters([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
64856.5632
Code language: CSS (css)
MilesToKilometers
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in miles to convert to kilometers. |
Example
MilesToKilometers([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
64.8565632
Code language: CSS (css)
RadiansToDegrees
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in radians to convert to degrees. |
Example
RadiansToDegrees([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
2309.01991437722
Code language: CSS (css)
PoundsToKilograms
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in pounds to convert to kilograms. |
Example
PoundsToKilograms([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
18.279772511
Code language: CSS (css)
PoundsToStone
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in pounds to convert to stone. |
Example
PoundsToStone([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
2.878571371
Code language: CSS (css)
StoneToPounds
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in stone to convert to pounds. |
Example
StoneToPounds([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
564.2
Code language: CSS (css)
KilogramsToPounds
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in kilograms to convert to pounds. |
Example
KilogramsToPounds([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
88.8463069
Code language: CSS (css)
KilopascalsToHectopascals
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in kilopascals to convert to hectopascals. |
Example
KilopascalsToHectopascals([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
403.0
Code language: CSS (css)
HectopascalsToKilopascals
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in hectopascals to convert to kilopascals. |
Example
HectopascalsToKilopascals([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
4030.0
Code language: CSS (css)
KilopascalsToPascals
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in kilopascals to convert to pascals. |
Example
KilopascalsToPascals([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
40300.0
Code language: CSS (css)
HectopascalsToPascals
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in hectopascals to convert to Pascals. |
Example
HectopascalsToPascals([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
4030.0
Code language: CSS (css)
AtmospheresToPascals
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in atmospheres to convert to pascals. |
Example
AtmospheresToPascals([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
4083397.5
Code language: CSS (css)
PascalsToAtmospheres
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in pascals to convert to atmospheres. |
Example
PascalsToAtmospheres([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
0.000397730076486553
Code language: CSS (css)
MetersToFeet
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in meters to convert to feet. |
Example
MetersToFeet([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
132.217847769029
Code language: CSS (css)
FeetToMeters
Function name is self describing.
Parameter | Type | Description |
---|---|---|
value | Double | The value in feet to convert to meters. |
Example
MetersToFeet([Value])
Code language: CSS (css)
Input
40.3
Code language: CSS (css)
Output
12.28344
Code language: CSS (css)
DistanceBetweenLocationsKms
Function name is self describing.
Parameter | Type | Description |
---|---|---|
latitudeFrom | Double | Latitude from |
longitudeFrom | Double | Longitude from |
latitudeTo | Double | Latitude to |
longitudeTo | Double | Longitude to |
Example
DistanceBetweenLocationsKms([LatitudeFrom], [LongitudeFrom],
[LatitudeTo], [LongitudeTo])
Code language: CSS (css)
Input
LatitudeFrom = 34.0522
LongitudeFrom = 118.2437
LatitudeTo = 40.7128
LongitudeTo = 74.0060
Output
3935.74625460972
Code language: CSS (css)
DistanceBetweenLocationsMiles
Function name is self describing.
Parameter | Type | Description |
---|---|---|
latitudeFrom | Double | Latitude from |
longitudeFrom | Double | Longitude from |
latitudeTo | Double | Latitude to |
longitudeTo | Double | Longitude to |
Example
DistanceBetweenLocationsMiles([LatitudeFrom], [LongitudeFrom],
[LatitudeTo], [LongitudeTo])
Code language: CSS (css)
Input
LatitudeFrom = 34.0522
LongitudeFrom = 118.2437
LatitudeTo = 40.7128
LongitudeTo = 74.0060
Output
2445.55934257047
Code language: CSS (css)
ROW_NUMBER
This function enables the caller to group records and apply row numbers to each resulting row in the output.
This is a standard SQL function that exists in most of the current relational database engines.
More information in this function and its usage can be found here … https://docs.microsoft.com/en-us/sql/t-sql/functions/row-number-transact-sql
The following example uses the Transform
API.
Each item in the response contains the row number at which that item exists in the resulting array.
Request
{
"transformations": {
"RowNumber": "ROW_NUMBER() OVER ()"
},
"preserveAllProperties": true,
"data": [
{
"CostCenter": "CC_2000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_3000"
},
{
"CostCenter": "CC_3000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_2000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_3000"
},
]
}
Code language: JSON / JSON with Comments (json)
Response
[
{
"CostCenter": "CC_2000",
"RowNumber": 1
},
{
"CostCenter": "CC_1000",
"RowNumber": 2
},
{
"CostCenter": "CC_1000",
"RowNumber": 3
},
{
"CostCenter": "CC_3000",
"RowNumber": 4
},
{
"CostCenter": "CC_3000",
"RowNumber": 5
},
{
"CostCenter": "CC_1000",
"RowNumber": 6
},
{
"CostCenter": "CC_2000",
"RowNumber": 7
},
{
"CostCenter": "CC_1000",
"RowNumber": 8
},
{
"CostCenter": "CC_3000",
"RowNumber": 9
}
]
Code language: JSON / JSON with Comments (json)
The following example uses the Transform
API.
Each row number is partitioned by the [CostCenter]
property and it’s because of this that the row number resets to 1 each time the value in the [CostCenter]
property changes.
Request
{
"transformations": {
"RowNumber": "ROW_NUMBER() OVER (PARTITION BY [CostCenter])"
},
"preserveAllProperties": true,
"data": [
{
"CostCenter": "CC_2000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_3000"
},
{
"CostCenter": "CC_3000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_2000"
},
{
"CostCenter": "CC_1000"
},
{
"CostCenter": "CC_3000"
},
]
}
Code language: JSON / JSON with Comments (json)
Response
[
{
"CostCenter": "CC_1000",
"RowNumber": 1
},
{
"CostCenter": "CC_1000",
"RowNumber": 2
},
{
"CostCenter": "CC_1000",
"RowNumber": 3
},
{
"CostCenter": "CC_1000",
"RowNumber": 4
},
{
"CostCenter": "CC_2000",
"RowNumber": 1
},
{
"CostCenter": "CC_2000",
"RowNumber": 2
},
{
"CostCenter": "CC_3000",
"RowNumber": 1
},
{
"CostCenter": "CC_3000",
"RowNumber": 2
},
{
"CostCenter": "CC_3000",
"RowNumber": 3
}
]
Code language: JSON / JSON with Comments (json)
PERCENT_RANK
This function enables the caller to calculate a percentile for each and every row in the resulting dataset.
This is a standard SQL function that exists in most of the current relational database engines.
More information in this function and its usage can be found here … https://docs.microsoft.com/en-us/sql/t-sql/functions/row-number-transact-sql
The following example uses the Transform
API.
Each item in the response has been ranked as per the resulting PERCENT_RANK() calculation.
Request
{
"preserveAllProperties": true,
"transformations" : {
"Percentile": "PERCENT_RANK() OVER(ORDER BY [Average])"
},
"sortOrder": {
"Percentile": "DESC"
},
"data": [
{
"Average": 328.32983
},
{
"Average": 427.43234
},
{
"Average": 245.34342
},
{
"Average": 863.92622
},
{
"Average": 123.13343
},
{
"Average": 432.54321
},
{
"Average": 376.34324
},
{
"Average": 876.37788
},
{
"Average": 723.54345
},
{
"Average": 328.32983
},
{
"Average": 734.85646
},
{
"Average": 352.43245
},
{
"Average": 953.86382
},
{
"Average": 672.82542
}
]
}
Code language: JSON / JSON with Comments (json)
Response
[
{
"Average": 953.86382,
"Percentile": 1.0
},
{
"Average": 876.37788,
"Percentile": 0.923076923076923
},
{
"Average": 863.92622,
"Percentile": 0.846153846153846
},
{
"Average": 734.85646,
"Percentile": 0.769230769230769
},
{
"Average": 723.54345,
"Percentile": 0.692307692307692
},
{
"Average": 672.82542,
"Percentile": 0.615384615384615
},
{
"Average": 432.54321,
"Percentile": 0.538461538461538
},
{
"Average": 427.43234,
"Percentile": 0.461538461538462
},
{
"Average": 376.34324,
"Percentile": 0.384615384615385
},
{
"Average": 352.43245,
"Percentile": 0.307692307692308
},
{
"Average": 328.32983,
"Percentile": 0.153846153846154
},
{
"Average": 328.32983,
"Percentile": 0.153846153846154
},
{
"Average": 245.34342,
"Percentile": 0.0769230769230769
},
{
"Average": 123.13343,
"Percentile": 0.0
}
]
Code language: JSON / JSON with Comments (json)