Array Function

  • Last update:  2020-12-17
  • ARRAY

    Description

    ARRAY(value_1, value_2, ...)

    Input

    value_1: the first element of array.

     

    value_2: the second element of array

    Output

    Produce an array whose elements are value_1, value_2, etc. Type: array


    Examples

    • ARRAY(1,2,"3") >> 1,2,three

    • ARRAY(1, ARRAY(2, 3)) >> 1,2,3

     

    If input 2 in D2:

    • ARRAY(1,D2) >> 1,2

    INARRAY

    Description

    INARRAY(value, searched_array)  

    Input

    value: the value to be matched. Type: string, number, etc.

     

    searched_array: the array whose elements are searched and compared to value. Type: array.

    Output

    Compare value to elements or searched_array. If value equals to any an element, return the position of the element. If none of the elements equal to value, return 0. Type: integer.

     

    Examples

    • INARRAY(2,ARRAY(1,2,3,4))

    • INARRAY(5,ARRAY(1,2,3,4))

     

    If multiple elements equal to value, only return the position of the one in the front.

    • INARRAY(1,ARRAY(1,2,3,1)) >> 1

     

    INDEXOFARRAY

    Description

    INDEXOFARRAY(searched_array, index)  

    Input

    searched_array: the array whose elements are searched. Type: array.

     

    index: a number to specify the position of an element. Type: integer.

    Output

    Return the element in searched_array whose position equals to index. Type: string, number, etc.

     

    Examples

    • INDEXOFARRAY(ARRAY("first", "second", "third"), 2) >> second

    RANGE

    Please reference Common function.


    REMOVEARRAY

    Description

    REMOVEARRAY(delete_array, start_position, delete_num)  

    Input

    delete_array: an array whose elements will be deleted. Type: array.

     

    start_position: the position start from which a series of elements will be deleted. Type: integer.

     

    delete_num: the number of elements to be deleted. Type: integer.

    Output

    Return a new array after delete the specified number of elements. Type: array.

     

    Examples

    • REMOVEARRAY(ARRAY(1, 2, 3, 4, 5, 6, 7), 4, 2) >> 1,2,3,6,7 

    SORTARRAY

    Description

    SORTARRAY(sort_array)  

    Input

    sort_array: the array whose elements will be sorted. Type: array.

    Output

    Return a new array after sort the elements of sort_array in the ascending order. Type: array.

     

    Examples

    • SORTARRAY(ARRAY(1,6,5,4,2)) >> 1,2,4,5,6

     

    UNIQUEARRAY

    Description

    UNIQUEARRAY(duplicate_array)  

    Input

    sort_array: an array that contains duplicated elements . Type: array.

    Output

    Return a new array after remove the duplicated elements in duplicate_array. Type: array.

     

    Examples

    • UNIQUEARRAY(ARRAY(1,1,2,3,3,4,4,5,6,6,1,2)) >> 1,2,3,4,5,6

    Array.cpt


    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy