4.6.8.2 Menu Options and Dialog ControlsWksSetColValMenuOptDialog
Formula Menu
The menu options under Formula are used to operate expressions, such as saving and loading expressions.

Load a sample formula.


Load a saved formula.


Save the current formula, including contents of Before Formula Scripts and Python Function tabs.


Save the formula to another name.

 You can also load formulas directly in the column label row F(x)= cell. Select the cell, then choose Column: Fill with User Formula; or rightclick in the cell and choose Load.

wcol(1) Menu
Origin lists all the columns of the current worksheet in the form of WCol(N): Short Name"Long Name", where N is the index of a column. You can select one of them to add to Column Formula or Before Formula Scripts so that you can use the column in your expression. Whether to add the selected column to the Column Formula edit box or the Before Formula Scripts edit box depends on where the cursor is.

You can select this menu option to add wcol(N) to Column Formula or Before Formula Scripts. N is the index of a column.


Select this to open the Column Browser dialog which helps you to choose the column to add.

Col(A) Menu
Origin lists all the columns of the current worksheet in the form of Col(Short Name): Long Name, such as Col(A): Time. You can select one of them to add to Column Formula or Before Formula Scripts so that you can use the column in your expression. Whether to add the selected column to the Column Formula edit box or the Before Formula Scripts edit box depends on where the cursor is.

Prefer using the long name to specify the colomn name, Col(Lone Name): short Name


You can select this menu option to add Col(Long Name) to Column Formula or Before Formula Scripts.


Select this to open the Column Browser dialog which helps you to choose the column to add.

Function Menu
This menu can be used to add functions for building the expression. You can select a function and insert it in either the Column Formula or the Before Formula Scripts edit box. Functions are inserted at the cursor.

Functions which have been used are automatically added to this menu.


Open the Search and Insert Functions dialog to search for builtin functions.


Select a function to add to Column Formula or Before Formula Scripts. For more on these functions, refer to LabTalk supported functions.

Variables Menu
The options in this menu have been supported since Origin 8.1 SR0. Use menu commands to insert variables into the Before Formula Script edit box.

Add a variable or a constant to Column Formula or Before Formula Scripts. Available variables and constants include:
 This
 Use to denote the current column. Use Thisn to refer to nth cell in the current column
 Note: this variable is only available when Spreadsheet Cell Notation is turned on. And it cannot be used in the Before Formula Script edit box.
 [i]
 Use to denote the row index.
 pi
 This is the PI constant.
 j
 Use to denote the column index.
 wcol(j)
 This is the Current column(s).

Project Variables

Add project variables to Column Formula or Before Formula Scripts. Up to 10 project variables (and their values) are listed in the submenu. View and select all project variables from the Project Variables dialog opened by clicking More... subitem.

Add Range Variable

Opens the Range Browser and helps you to define range variables.

Add Info Variable

Opens the Insert Variable dialog Info tab, to help you insert variable values and file metadata stored in the page object.
One of the more useful options here is to store key variable values in System Variables v1  v4. This allows you to store a limited number of numeric values (type = double) in the workbook. For guidance, see the Example at the end of this section.

Add Column Label Cell

Opens the Insert Variable dialog Label tab, to help you insert variables associated with column label cells. Hint: Use the panel to the right side to choose the book, sheet and column that contains the label cell data that you wish to insert.

Add Range Variable by Selection...

It minimizes the Set Column Values dialog to select the range variable from Worksheet to insert.

Add Column Label Cell by Selection...

It minimizes the Set Column Values dialog to insert variables that point to column label cells by selection.

 When a range variable has been added through Add Range Variable by Selection menu for the first time, an Insert Mode dialog pops up and you could select different syntax referring to a range. Available options are Column Notation: Col(A), Long Name : A, Short Name : A and Index : wcol(1).

Example: Inserting SYSTEM variables into your column formula
The workbook can store four numeric (double) values and four string variable values. These predefined SYSTEM variables can be used, among other things, to store key workbookspecific values that you might use in column values calculations.
 Begin by opening a fresh workbook window. This would be workbook that you intend to use for your column values calculations.
 With this workbook window active, open the Script Window (Window: Script Window), type the following and press Enter.
page.v1=1.117
 Rightclick on the worksheet column you want to use in calculations and choose Set Column Values.
 Let's assume we want to multiply our column A values by our new "v1" variable value of 1.117. Begin by entering "A" in the top, column formula box.
 From the Set Values Variables menu, choose Add Info Variable...
 Expand the System Formula node, highlight your variable v1 (and its value of 1.117) and click Insert, then Close. Note that the Set Values dialog now displays the following expression in the Before Formula Scripts panel.
double d1 = page.info.SYSTEM.FORMULA.V1;
 The value stored in v1 has now been assigned to a variable named d1 of type double. In order to use this to multiply our column A values by 1.117, we have to add it to the top panel expression:
A * d1
 Click Apply or OK to perform your column calculation. Note that should you save the book as a separate window (apart from the project), the variable value will be saved in the book.
Options Menu
Direct Edit Formula Cell

This option is enabled by default. Checking this option allows direct editing of the formula in the cell.

Formula Text...

This option is available when Direct Edit Formula Cell is disabled. Selecting this option opens the Formula Text dialog box, prompting you to enter the text you want to be displayed in the formula cell in the F(x) label row. Note that if the Formula Text box is left empty, the column formula is displayed in the formula cell. Hint: If you want the formula cell to display nothing, you can type a space in the Formula Text box.

Keep Text

When checked, text in destination columns will be kept instead of becoming missing values when doing calculations.

Range/Column controls
Define the range of the values whose values will be set with the expression.
If you have selected part of a column(multiple columns) before opening the Set Values dialog box, the starting and ending row indices will be automatically displayed in the Row (i): From and To boxes (selecting an entire column will set both boxes to <auto>). Please note that noncontiguous range selection is not supported. To change the range, you can overwrite the values in the From and To boxes.
Specify the columns whose values will be set with the expression. This control is only available when set multiple columns values.
If you have selected multiple columns before opening the Set Values dialog box, the starting and ending columns indices will be automatically displayed in the Col (j): From and To boxes. Please note that noncontiguous columns are not supported. To change the columns, you can overwrite the values in the From and To boxes.
Target Column
This noneditable field identifies the column or columns to which the Column Formula and/or Before Formula Scripts expression(s) should apply.
Column First/Next/Prev/Last
You can use this group of buttons to switch from one column to another. This allows you to use the Set Values dialog on multiple columns without closing the dialog.
Column Formula
You can add a single line expression in this edit box for generating data. Functions, conditional operator and variables can be used here.
Recalculate
Buttons
Search and Insert Functions dialog

Open the Search and Insert Functions dialog by clicking button.

Switch to Column Properties dialog

Switch to the column properties dialog by clicking button.

Apply

Set values with the expression without closing the dialog box.

Cancel

Close the dialog box and do nothing.

OK

Set values with the expression and then close the dialog box.

Show/Hide Scripts (Up Arrow button)

Show or hide the Before Formula Scripts panel.

Before Formula Scripts
You can enter multiline LabTalk scripts in this edit box and the scripts will be executed before the expression in Column Formula edit box is executed. You can click the Show/Hide Scripts button to show/hide this edit box.
Search and Insert Functions
To search for a function, first enter keywords in function search input box and all related functions will be listed with function names and descriptions. You can then navigate to desired function and add the function to Set Values dialog box by double clicking the function name. To view more details of that function, you can go the corresponding function page by click the description part of the function.
 Besides in the Set Values dialog, you also can open the Search and Insert Functions dialog in these tool/ menu.
 Select Tools: Search Functions in the menu. In the dialog opened by this menu, you can select and copy formula information as text to paste to Notepad.

