Page History
Visual Analytics allows you to create Calculated Fields that are composed of Custom Expressions containing Fields, Parameters, and/or Functions. The created Calculated Fields reside in the Dimension or the Measures pane and can be used anywhere Dimension or Measure fields are supported. These Calculated Fields display the icon of function with their name.
Contents
Create a Calculated Field
To create a Calculated Field
- Right-click anywhere in the Data pane and then click Create Calculated Field.
- In the Create Calculated Field dialog, specify a name for the Calculated Field you want to create.
- In the Expression area, write a formula for the Calculated Field. You can include any field, parameter or function in the formula from the Fields, Parameters or Functions area by double-clicking it. The information(Data Type and Type) about the selected field, parameter or function is displayed next to the Functions area.
- Click Save to create the Calculated Field.
The created Calculated Field is displayed in the Dimensions or the Measures pane depending upon which Data Type is produced by your calculation (dates or strings are Dimensions, numbers are Measures). All the created Calculated Fields display the function icon (ƒx) with their names that make them recognizable.
Info |
---|
All Visual Analytics workbooks automatically create the Number of Records Calculated Field after connecting to the Data Source. |
Right-click a Calculated Field and then click Edit to make changes in the Calculated Field. Also, you can change the name of the Calculated Field by selecting Rename.
Calculated Field Editor Options
- Autocompletion
- Punctuation Completion
- Right-Click Options on the Annotation Bar
- Toolbar Options
- Find and Replace
- Go To Line
- Syntax Color
Autocompletion
Autocompletion functionality provides suggestions while you type. The autocompletion list displays the field names and parameters of the current data sourceand the in-built calculated field functions along with its arguments and return type.
By default, the autocompletion list is sorted by relevance (), meaning, the most recently used entries are shown on top. You can change this sorting order to alphabetical (lexicographical ), as shown in the screenshot.
Punctuation Completion
Punctuation Completion works for quotes, parentheses, braces, and square brackets. After typing an opening identifier, the editor adds a matching closing identifier and places the cursor between them. For the punctuation completion settings, the calculated field editor considers the settings in the Options dialog of the Javascript editor. For more information, see Editor Options.
Right-Click Options on the Annotation Bar
You can customize your editor, by using these right-click options on the Annotation Bar:
- Show Whitespaces: display white spaces or tabs.
- Show Line Numbers: display line numbers for each line (default selection when you open the editor for the first time).
- Show Indent Guides: display vertical indent lines to easily understand the hierarchy of the structured statement (default selection when you open the editor for the first time).
- Use Soft Wraps: wrap longer lines exceeding the editor window to the next line.
Info |
---|
The editor preserves user-specified indents and spacing between expressions. |
Toolbar Options
You can modify the expression by using the options in the toolbar.
The following table describes the options in the toolbar along with the keyboard shortcuts.
Toolbar Option | Keyboard Shortcuts | Description |
CTRL+X (Windows/Linux) | Remove the selected text from the editor. | |
CTRL+C (Windows/Linux) | Copy the selected text to a different editor. | |
CTRL+V (Windows/Linux) | Paste the content copied from a different source into the current editor. | |
CTRL+Z (Windows/Linux) | Undo the last action. | |
CTRL+SHIFT+Z (Windows/Linux) | Redo the last action. | |
CTRL+F (Windows/Linux) | Show the Find toolbar. | |
CTRL+H (Windows/Linux) | Show the Find and Replace toolbar. | |
CTRL+L (Windows/Linux) | Change the current word or selected text to lower case. | |
CTRL+U (Windows/Linux) | Change the current word or selected text to upper case. |
Find and Replace
You can find or find and replace specific text in the current file by using various toolbar options and keyboard shortcut keys.
Find
The Find toolbar appears right below the editor’s toolbar when you click on the editor’s toolbar or use CTRL+F keystroke.
- When you insert a string in the text box, the find operation immediately highlights every occurrence of the searched string in the current editor. To navigate between occurrences, use toggle buttons (, ), shortcut keys; F3 (next occurrence) or SHIFT+F3 (previous occurrence), or marker bars.
- Additionally, you can:
- Set the search criterion such as the use of regular expressions, case-sensitive, and complete text match.
- Add, delete, select/unselect all occurrences from the find operation by using toggle buttons (, , ).
- View the count of the found occurrences in the upper-right corner of the toolbar.
Find and Replace
- The Find and Replace toolbar appear right below the editor’s toolbar when you click on the editor’s toolbar or use CTRL+H keystroke.
- Additionally, you can:
- Find and replace the highlighted text or replace all occurrences of the highlighted text at once.
- Exclude/include text in the replace operation. When excluding, the editor strikes off the current occurrence and moves to the next occurrence.
- Preserve the case of the found occurrences, and replace text only for the selected lines of the expression as the replace criterion.
- View the count of the found occurrences in the upper-right corner of the toolbar.
You can use the recent search history () to see the list of the last few entries used for the find and find and replace operations.
Go To Line
Go to Line navigates you to a specific line in the editor based on the user-defined number. You can view the current line and column number in the Status Bar. The line and column number are separated by a colon. To navigate to a specific line, click CTRL+G (Command key on Mac) and open the Go To Line dialog. Type the new line and column number separated by a colon, and then click OK.
Syntax Color
You can modify the appearance of your editor by using various appearance options; such as editor, search match background, and foreground colors, adjust caret blink rate, style, and color in the Options dialog. For more information, see Editor Options.
Info |
---|
The editor also displays the encoding and line separator information in the Status Bar. These settings are not configurable. Depending on the OS of your machine, your editor will show the line separator in use; CRLF for Windows and LF for UNIX and OS(X). UTF-8 is the default encoding. |