Difference between revisions of "Excel to Analytica Mappings/Text and Data Functions"
(One intermediate revision by the same user not shown) | |||
Line 13: | Line 13: | ||
== BAHTTEXT(number) == | == BAHTTEXT(number) == | ||
− | Analytica does not contain support the Thai (Baht) language. | + | Analytica does not contain support for the Thai (Baht) language. |
== CHAR(number) == | == CHAR(number) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[Chr]](number) | |
== CLEAN(x) == | == CLEAN(x) == | ||
Line 24: | Line 24: | ||
== CODE(text) == | == CODE(text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[Asc]](text) | |
== CONCATENATE(text1, text2, ...) == | == CONCATENATE(text1, text2, ...) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :text1 & text2 & ... | |
Also: | Also: | ||
− | + | :[[Join]](A, I) | |
== DOLLAR(number'', decimals'') == | == DOLLAR(number'', decimals'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :"" & number | |
where the number format for the variable where this expression appears is set to currency with the indicated number of digits. | where the number format for the variable where this expression appears is set to currency with the indicated number of digits. | ||
== EXACT(text1, text2) == | == EXACT(text1, text2) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :text1 == text2 | |
== FIND(find_text, within_text'', start_num''), FINDB(find_text, within_text'', start_num'') == | == FIND(find_text, within_text'', start_num''), FINDB(find_text, within_text'', start_num'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[FindInText]](find_text, within_text'', start_num'') | |
== FIXED(number'', decimals, no_commas'') == | == FIXED(number'', decimals, no_commas'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :"" & number | |
where the number format for the current variable is set to fixed format with the indicated number of decimals, and thousands separators checked or unchecked as desired. | where the number format for the current variable is set to fixed format with the indicated number of decimals, and thousands separators checked or unchecked as desired. | ||
Line 63: | Line 63: | ||
== LEFT(text'', num_chars''), LEFTB(text'', num_chars'') == | == LEFT(text'', num_chars''), LEFTB(text'', num_chars'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[SelectText]](text, 1, num_chars) | |
== LEN(text), LENB(text) == | == LEN(text), LENB(text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[TextLength]](text) | |
== LOWER(text) == | == LOWER(text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | : [[TextLowerCase]](text) | |
== MID(text, start_num, num_chars), MIDB(text, start_num, num_chars) == | == MID(text, start_num, num_chars), MIDB(text, start_num, num_chars) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent: '' |
− | + | :[[SelectText]](text, start_num, start_num + num_chars - 1) | |
== PHONETIC == | == PHONETIC == | ||
− | No Analytica equivalent. | + | ''No Analytica equivalent.'' |
== PROPER(text) == | == PROPER(text) == | ||
− | No Analytica equivalent. | + | ''No Analytica equivalent.'' |
== REPLACE(old_text, start_num, num_chars, new_text) == | == REPLACE(old_text, start_num, num_chars, new_text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[SelectText]](old_text, 1, start_num - 1) & new_text & [[SelectText]](old_text, start_num + num_chars) | |
== REPT(text, n) == | == REPT(text, n) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :Index J := 1..n do Join(text, J) | |
== RIGHT(text'', num_chars''), RIGHTB(text'', num_chars'') == | == RIGHT(text'', num_chars''), RIGHTB(text'', num_chars'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[SelectText]](text, [[TextLength]](text)-num_chars) | |
== SEARCH(find_text, within_text'', start_num''), SEARCHB(find_text, within_text'', start_num'') == | == SEARCH(find_text, within_text'', start_num''), SEARCHB(find_text, within_text'', start_num'') == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[FindInText]]( find_text, within_text'', start_num'') | |
== SUBSTITUTE(text, old_text, new_text'', instance_num'') == | == SUBSTITUTE(text, old_text, new_text'', instance_num'') == | ||
− | Analytica equivalent when | + | Analytica equivalent when «instance_num» is not specified: |
− | + | :[[TextReplace]](text, old_text, new_text, all:true) | |
− | Analytica equivalent when | + | Analytica equivalent when «instance_num»' equals 1: |
− | + | :[[TextReplace]](text, old_text, new_text) | |
== T(value) == | == T(value) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :If [[IsText]](value) then value else "" | |
== TEXT(value, format_text) == | == TEXT(value, format_text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :"" & value | |
where the number format for the variable containing this expression is set to the desired number format. | where the number format for the variable containing this expression is set to the desired number format. | ||
== TRIM(text) == | == TRIM(text) == | ||
− | Analytica equivalent | + | ''Analytica equivalent:'' |
− | + | :[[TextTrim]](text) | |
== UPPER(text) == | == UPPER(text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[TextUpperCase]](text) | |
== VALUE(text) == | == VALUE(text) == | ||
− | Analytica equivalent: | + | ''Analytica equivalent:'' |
− | + | :[[ParseNum]](x) | |
− | To use [[ParseNum]], you must add the Flat File Library to your model. | + | To use [[ParseNum]], you must add the [[Standard_libraries#Flat_File_Library|Flat File Library]] to your model. |
− | You can also coerce a text string to a number in other ways. For example, [[Evaluate]](x) will do it. You can also specify a parameter to a | + | You can also coerce a text string to a number in other ways. For example, [[Evaluate]](x) will do it. You can also specify a parameter to a [[User-Defined Function]] as <code>x : coerce number</code>, which will cause the input to be coerced. |
− | ==See Also | + | ==See Also== |
* [[Excel to Analytica Mappings]] | * [[Excel to Analytica Mappings]] |
Latest revision as of 23:37, 16 March 2016
This page shows how Excel Text and Data functions map to Analytica equivalents
ASC(text)
Analytica's Asc function is not an equivalent to Excel's ASC function. Excel's ASC function converts double-byte character sets to single-byte character sets. Analytica has no support for double-byte character sets.
BAHTTEXT(number)
Analytica does not contain support for the Thai (Baht) language.
CHAR(number)
Analytica equivalent:
- Chr(number)
CLEAN(x)
CODE(text)
Analytica equivalent:
- Asc(text)
CONCATENATE(text1, text2, ...)
Analytica equivalent:
- text1 & text2 & ...
Also:
- Join(A, I)
DOLLAR(number, decimals)
Analytica equivalent:
- "" & number
where the number format for the variable where this expression appears is set to currency with the indicated number of digits.
EXACT(text1, text2)
Analytica equivalent:
- text1 == text2
FIND(find_text, within_text, start_num), FINDB(find_text, within_text, start_num)
Analytica equivalent:
- FindInText(find_text, within_text, start_num)
FIXED(number, decimals, no_commas)
Analytica equivalent:
- "" & number
where the number format for the current variable is set to fixed format with the indicated number of decimals, and thousands separators checked or unchecked as desired.
JIS(text)
No Analytica equivalent, since Analytica does not support double-byte characters.
LEFT(text, num_chars), LEFTB(text, num_chars)
Analytica equivalent:
- SelectText(text, 1, num_chars)
LEN(text), LENB(text)
Analytica equivalent:
- TextLength(text)
LOWER(text)
Analytica equivalent:
- TextLowerCase(text)
MID(text, start_num, num_chars), MIDB(text, start_num, num_chars)
Analytica equivalent:
- SelectText(text, start_num, start_num + num_chars - 1)
PHONETIC
No Analytica equivalent.
PROPER(text)
No Analytica equivalent.
REPLACE(old_text, start_num, num_chars, new_text)
Analytica equivalent:
- SelectText(old_text, 1, start_num - 1) & new_text & SelectText(old_text, start_num + num_chars)
REPT(text, n)
Analytica equivalent:
- Index J := 1..n do Join(text, J)
RIGHT(text, num_chars), RIGHTB(text, num_chars)
Analytica equivalent:
- SelectText(text, TextLength(text)-num_chars)
SEARCH(find_text, within_text, start_num), SEARCHB(find_text, within_text, start_num)
Analytica equivalent:
- FindInText( find_text, within_text, start_num)
SUBSTITUTE(text, old_text, new_text, instance_num)
Analytica equivalent when «instance_num» is not specified:
- TextReplace(text, old_text, new_text, all:true)
Analytica equivalent when «instance_num»' equals 1:
- TextReplace(text, old_text, new_text)
T(value)
Analytica equivalent:
- If IsText(value) then value else ""
TEXT(value, format_text)
Analytica equivalent:
- "" & value
where the number format for the variable containing this expression is set to the desired number format.
TRIM(text)
Analytica equivalent:
- TextTrim(text)
UPPER(text)
Analytica equivalent:
- TextUpperCase(text)
VALUE(text)
Analytica equivalent:
- ParseNum(x)
To use ParseNum, you must add the Flat File Library to your model.
You can also coerce a text string to a number in other ways. For example, Evaluate(x) will do it. You can also specify a parameter to a User-Defined Function as x : coerce number
, which will cause the input to be coerced.
Enable comment auto-refresher