0% found this document useful (0 votes)
12 views2 pages

Common @functions

common cit environments

Uploaded by

Mayen Drive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Common @functions

common cit environments

Uploaded by

Mayen Drive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Common @Functions

FUNCTIONS FUNCTIONALITY EXAMPLES


FieldName1 = “20111230” FieldName2 = “20111220”
Returns the number of days between two specified dates.
@age( ) thus using: @age(FieldName1, FieldName2) yields the result: 10 (10 day difference)
Note: both dates must be a “Date” field type.
(Make sure that the latest date is FieldName1)
A conditional statement which tests for multiple conditions FieldName= “NAME”
@compif() and provides results depending on the outcome. Very thus using: @compif(NAME==”Bob”, 1, NAME==”Tom”, 2, NAME==“Ann”, 3) will return
helpful when stringing together multiple “if” statements. 1, 2 or 3 depending on if the NAME field contains Bob, Tom or Ann.
FieldName = “12/20/11”
thus using: @ctod(FieldName, “MM/DD/YY”) yields the result: “20111220” (difference
Converts a field containing dates stored as a character field is this is now a date field type and no longer a character string and is accepted in
@ctod( )
type into a Date field type in IDEA’s Date format. functions requiring Date arguments.) Note the order of YYYYMMDD with the absence
of extraneous separators. IDEA stores dates in this fashion, though they will appear as
MM/DD/YYYY.
ColumnOne = 1, 2, 3, 4, 5 | ColumnTwo = @getnextvalue(“ColumnOne”), so it will contain
Returns the value of the next record from the specified field, values: 2, 3, 4, 5, 0
@getnextvalue( )
starting with the first record. (For parallel columns, this will fill each row of the current column with the value of the
row below from the corresponding column.)
ColumnOne = 1, 2, 3, 4, 5 | ColumnTwo = @getpreviousvalue(“ColumnOne”), so it will
Returns the value in the preceding record for the specified contain values: 0, 1, 2, 3, 4
@getpreviousvalue( )
field, starting with the first record. (For parallel columns, this will fill each row of the current column with the value of the
row above it from the corresponding column.)
@if(10 > 6, “10 is larger than 6”, “10 is less than 6”) yields the result: “10 is larger than
Tests a specified condition and if the result is true then it
6.” First part accepts the values to test with a relational operator in between (>, <, =, ==,
@if( ) will return the first result (true), otherwise it returns the
<>, <=, >=), second part is the result if the test is true (in this case 10 is greater than 6, so
second result (false).
it outputs the second item.), last part results if the test were to return false.
Searches for the occurrence of a specified character string
(of any case) in a character field or date field. If appending a
FieldName = “sample string”
field and the string is found, it returns the starting position
@isini( ) thus using: @isini(“mpl “, FieldName) in an appended field yields the result: 3
of the specified character string; otherwise, a 0 is returned.
(determined the position where the string began); in an extraction the record is extracted.
If used in an extraction, the record is extracted if the
character string is found.
Returns characters, spaces and special characters from the FieldName = “23W45 E% $R#T”
@justletters( )
character string or field by removing any numbers. thus using: @justletters(FieldName) will yield: “W E% $R#T”
Returns only the numbers from the specified character FieldName = “W987DTR^3&*%”
@justnumbers( )
string or field. thus using: @justnumbers(FieldName) will yield: 9873
If you get stuck along the way, use our “20 Minute Rule,” which is designed to save
you time and effort. If it takes you more than 20 minutes to utilize any IDEA function or Learn more about IDEA and IDEA training
feature, contact us for assistance - 888.641.2800 Option 4 • [email protected] opportunities at audimation.com.

FUNCTIONS FUNCTIONALITY EXAMPLES


Returns the specified number of leftmost characters from FieldName = “word”
@left( )
the beginning of the character field. thus using: @left(FieldName, 2) will yield: “wo”
Reviews a character expression and returns the length of FieldName = “this sentence has 31 characters”
@len( )
the character string, including spaces. thus using: @len(FieldName) will yield: 31
FieldName = “UPPER CASE”
@lower( ) Converts a character field into lower case.
thus using: @lower(FieldName) will yield: “upper case”
Extracts a sub-string of a character field. You will need
to specify the character field, the starting position of the FieldName = “my phrase”
@mid( )
sub-string within the character field and the number of thus using: @mid(FieldName, 2, 6) will yield: “y phra”
characters.
FieldName = “Left to right”
@reverse( ) Reverses a string of characters.
thus using: @reverse(FieldName) will yield: “thgir ot tfeL”
Identifies the specified number of rightmost characters in FieldName = “word”
@right( )
the character field. thus using: @right(FieldName, 2) will yield: “rd”
Removes all extra spaces from a cell, leaving a single space FieldName = “ too many spaces “
@spacestoone( )
between phrases. thus using: @spacestoone(FieldName) will yield: “too many spaces”
Returns the characters in a field from the first character up FieldName = “My Sentence”
@spanexcluding( )
to, but not including, the character specified. thus using: @spanexcluding(FieldName, “ “) will yield: “My”
FieldName= “123-45-6789”
Breaks a character string into segments by breaking on
thus using: @simplesplit(FieldName,”-”,1,”-”) will yield “45”. The first “-” tells it
@simplesplit( ) a specified character or character string(such as :,/,-,...)
what the starting separator is. The 1 tells it to grab the first segment that starts
within the string and returns a specified segment.
with a “-” and ends with a “-”. The second “-” tells it what the ending separator is.
FieldName = 12345
Converts a number stored as a numeric data type into thus using: @str(FieldName,0,0) will yield: “12345”. The first 0 is the minimum
@str( )
a character data type. length of the string and the second 0 is the decimals required. The content will be
left justified in the new field.
Removes all spaces, punctuation and special characters FieldName = “-109A B,V=$%”
@strip( )
from a text field leaving a string of characters and numbers. thus using: @strip(FieldName) will yield: “109ABV”
FieldName = “lower case”
@upper( ) Converts a character field into upper case.
thus using: @upper(FieldName) will yield: “LOWER CASE”
Converts a number stored as a character data type
FieldName=”123AB4” (as a character field)
@val() to a numeric data type. Useful when a field contains
thus using: @val(FieldName) will yield: “123” in a numeric field.
numbers which need to be used to perform calculations.

You might also like