Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Mathematical operation in different cell in alteryx

rohit782192
8 - Asteroid

I have a value in two different cell at two different locations.

I want to do a difference 

[Cell1] at 1st position and [Cell2] at last position.

 

I want to do [Cell2]-[Cell1]

Comment: Both are in different column and far away from each other.

 

In excel it is simple to do.

 

How can we do in alteryx

 

 

7 REPLIES 7
Luke_C
13 - Pulsar

Hi @rohit782192 

 

If I understand correctly, you want to subtract the first row of data for a field from the last row of data from another field (or same field). Assuming this is true, you can use the 'First' and 'Last' operators in the summarize tool to isolate them and then a formula tool to do the calculation. If you have sample data that would be helpful.

T_Willins
13 - Pulsar
13 - Pulsar

Hi @rohit782192,

 

Distance between the fields doesn't matter.  Since you use position, I am going on the assumption that the field names are not always consistent.  If the field names are always the same for Cell1 and Cell2, then this can be accomplished in a single formula tool with the formula [Last Field] - [First Field] where the names in the brackets are your actual field names.  As @Luke_C mentioned, you can extract first and last fields.  Attached is a workflow with sample data showing this.

 

workflow.png

DawnDuong
11 - Bolide
11 - Bolide

Hi @rohit782192 

If the columns / fields are not always consistently positioned, you can try build an app to let the user select column for first value and column for last value and then do the First/Last operation like what @Luke_C  mentioned.

Cheers

Dawn

rohit782192
8 - Asteroid

Capture.PNG

Hope this clarify the example.

T_Willins
13 - Pulsar
13 - Pulsar

HI @rohit782192

 

The results can be put in different places, but this closely matches your example.

workflow v2.png

 

rohit782192
8 - Asteroid

In Simple way we can apply filter but in the million of data  file it will be difficult to use the filter.

 

DawnDuong
11 - Bolide
11 - Bolide

@rohit782192 

If you have many columns and it is difficult to specify names of First and last columns, you can try something like the schema below, which is generalized to accept any number of rows and columns as as long as the format of the data contains the header in the first row and data from row 2 onwards. Hope this works for you.

2) Screen Math example.PNG

 

 

 

Labels