The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Create Calculated Field that Subtracts Field 1 from Field 2 (within same Column)

felixcaspari
メテオール

I would like to create a calculated field (as displayed in column E) that locates the lowest system ID (column B) within a project ID (column A) and populates "E3" with the number found in the combined hours (column C) column. "E4" should be "C4" minus "E3". "E5" should be "C5" minus sum(E3:E4).

 

The process should be repeated for Project ID 2 starting in "E6".

 

I would like to point out, that system IDs are generated on a +1 basis, so you would never see a system ID that is smaller than its predecessor (within the same project ID) 

 

Calculated_Field_Alteryx_Community.png

 

I look forward to your responds- thank you in advance for the support.

 

 

4件の返信4
cmcclellan
マグネター

2018-12-13 14_35_09-Alteryx Designer x64 - New Workflow3_.png

 

I'm pretty sure this is what you're after :) 

MarshallG
アステロイド

They key to this is using the multi-row formula. First, sort by your project_ID and System_ID (you've already done that for us with your sample data) and then use a multi-row formula to compare the previous row's value for Combined_Hours. Workflow attached.

felixcaspari
メテオール
 
felixcaspari
メテオール

Thank you! This was very helpful and is working on my actual data set.

ラベル
トップのソリューション投稿者