create_mutually_exclusive()

create_mutually_exclusive()

create_mutually_exclusive(name, col1name, col2name)

Combines two column together, creating a new column.:func:create_mutually_exclusive combines the two source columns cells together so that the new column includes all of the arguments from both source columns. It also includes a combination of the two columns’ cells as well as a new cell for each overlap.

Parameter

Type

Description

name

String

The name of the new column you wish to create.

col1name

String

The name of the first source column to combine.

col2name

String

The name of the second source column to combine.

Returns

The new Ruby representation of the column. You must write the changes back to the spreadsheet if you want to save them.

Example

The following example creates a column called “test” from two existing columns, “col1” and “col2”, and then writes the changes back to the spreadsheet using setColumn().

require 'Datavyu_API.rb'
begin
   test = create_mutually_exclusive("test", "col1", "col2")
   setColumn("test", test)
end