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
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.
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.
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
Hope this clarify the example.
In Simple way we can apply filter but in the million of data file it will be difficult to use the filter.
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)