Point and click interaction for calculate

Description

As a user, I want to perform calculations on numeric data or string data.
These directives can be specifically applied to data that is formatted as either Numeric or String.
The system is able to recognize the type of data and present directives that are applicable to each of the formats.
If the system is unable to recognize the type of data, all options are presented to the user, organized under the type of formats.

Numeric Data
As a user, I can perform the following calculation when my data type is Numeric.

Operation

Descripton

Requires user input

Expression

Add

Add a user-input value to the existing column or results can be organized in a new column

Yes

<column> + n

Subtract

Subtract a user-input value to the existing column or results can be organized in a new column

Yes

<column> - n

 

Multiply

Multiplies a user-input value to the existing column or results can be organized in a new column

Yes

<column> * n

 

Divide

Divides a user-input value to the existing column or results can be organized in a new column

Yes

<column> / n

 

Modulo

Calculate remainder of nearest product

Yes

<column> % n

 

Exponent (math:pow) Elevate to the power

Use a user-input value as exponent

Yes

math:pow(<column>, n)

Absolute Value

Map negative integers to positive and positive to positive

No

math:abs(<column>)

Sin

Trig sin function

No

math:sin(<column>)

Cos

Trig sin function

No

math:cos(<column>)

Tan

Trig tan function

No

math:tan(<column>)

Arccos

Trig arccos function

No

math:acos(<column>)

Arcsin

Trig arcsin function

No

math:asin(<column>)

Arctan

Trig arctan function

No

math:atan(<column>)

Square

Power of 2

No

math:pow(<column>, 2)

Square root

Power of 1/2

No

math:sqrt(<column>)

Cube

Power of 3

No

math:pow(<column>, 3)

Cube root

Power of 1/3

No

math:cbrt(<column>)

Log

Base 10

No

math:log10(<column>)

Natural log

Base e

No

math:log(<column>)

Round

Nearest integer

No

math:round(<column>)

Ceil

Nearest integer up

No

math:ceil(<column>)

Floor

Nearest integer down

No

math:floor(<column>)

Random

Generate in range [0, 1)

No

math:random(<column>)

String Data
Numeric Data
As a user, I can perform the following calculation when my data type is String.

Operation

Action

Requires user input

Expression

Character Count

Counts the number of characters in any rows and copy the results in a new column; the new column is named by default, but the user can edit the name (Name destination pattern and error handling is applicable)

Yes

string:length(<column>)

The system is not able to recognize the data
When the system is not able to recognize the type of data, I want to see all operations (order: string and then numeric ).

Acceptance Criteria

  • The type of operations are organized and labeled based on the type of data to which they can be applied

  • In the submenu, "Calculate" is in its own section together with "Format" and "Custom JXL Transform"

  • On hover, the background of the menu item changes.

  • If the vertical space is limited and not all operations can be shown at once, the user is able to scroll through by clicking the top and bottom arrow (see mock up)

  • The line height for the items in the menu and submenu is 28px; if the items have a separator, the height is 32px

  • Error messages are handled using current visual pattern

Release Notes

Adds Calculate directive to the directives dropdown in Data Prep.

Attachments

7

Activity

Show:

Tony Bach July 17, 2017 at 6:05 PM

Lea Cuniberti-Duran July 13, 2017 at 11:48 PM
Edited

Let change the label "Create new column" to "Copy to a new column"
I think it is more accurate and descriptive

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Affects versions

Components

Sprint

Fix versions

Priority

Created July 11, 2017 at 5:43 PM
Updated August 25, 2017 at 6:21 AM
Resolved July 18, 2017 at 4:13 AM