ARRAY

ARRAY lets you join together single values and return those values as a single column of data in the order provided. You can use ARRAY to combine data from different data sources. See using multiple data sources in a single Klip for more information.

The syntax for ARRAY is:

ARRAY(data)

Parameters

data The value or values vector

Use ARRAY to combine data from two data sources

The following examples are based on the two data sources shown below.

Data source 1:

  A B C D
1 Apples 10 20 30
2 Oranges 1,000 2,000 3,000

 

Data source 2:

  A B C D
1 Pears 40 70 50
2 Lemons 8,000 3,000 2,000
3 Bananas 4,000 9,000 5,000
4 Cherries 430 234 600

 

This example shows two different columns selected from two different data sources and returns the content of both columns in one column.

ARRAY( values1, values2 )   

  • values1: set to column A (A:A) of data source 1.
  • values2: set to column A (A:A) of data source 2. 

Results: Apples, Oranges, Pears, Lemons, Bananas, Cherries

Use ARRAY to add a value to a list

You can use ARRAY to add an additional value to a list of grouped values. 

The example below shows the formula from a drop-down list in the User Input Control component using data source 2 from above. This formula will return the values in column A and the value "All" as selectable options from the drop-down list.

ARRAY("string", GROUP(values))

  • string: set to the additional option, "All".
  • values: set to the fruit types, column A (A:A).

Results: All, Pears, Lemons, Bananas, Cherries

Use ARRAY to exclude values in COUNT_DAYS

You can use ARRAY to exclude a list of values from a range of values.

In the example below, ARRAY is used to exclude Saturdays and Sundays from the number of days counted between July 1, 2016 and July 31, 2016.

COUNT_DAYS( DATE("date1", "format"), DATE("date2", "format"), ARRAY("data1", "data2"))

  • date1: set to the start date, "July 1, 2016".
  • format: set to the format, "MMMM d, yyyy".
  • date2: set to the end date, "July 31, 2016". 
  • data1: set to "Sat".
  • data2: set to "Sun".

Result: 21

Related links: