Alteryx Designer Desktop Discussions

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

Calculating one column from other column

Alteryxexpert
8 - Asteroid

I have Data Below 

sub itemitemSplitValueDate
Chair_4Chair 790,00012/31/2023
Chair_3Chair 45,45412/31/2023
Chair_2Chair 77755512/31/2023
Chair_1Chair 565,66612/31/2023
Chair_0Chair 888,99912/31/2023
Table_4Table 790,00012/31/2023
Table_3Table 45,45412/31/2023
Table_2Table 77755512/31/2023
Table_1Table 565,66612/31/2023
Table_0Table 888,99912/31/2023
Chair_4Chair 790,0001/1/2024
Chair_3Chair 45,4541/1/2024
Chair_2Chair 7775551/1/2024
Chair_1Chair 565,6661/1/2024
Chair_0Chair 888,9991/1/2024
Table_4Table 790,0001/1/2024
Table_3Table 45,4541/1/2024
Table_2Table 7775551/1/2024
Table_1Table 565,6661/1/2024
Table_0Table 888,9991/1/2024

 

I want to calculate the split(3rd Column) Based on the value column.

The Logic is :

For a specific period(31-12-2023) the calculation for chair_4 should be, 79000/(790,000 +45,454 +777555+565,666 +888,999), and for chair_3 it should be 45454/(790,000 +45,454 +777555+565,666 +888,999) and it should calculate in the same way for all the items.

Datatype:

Value:Numeric

Date:Date

Rest all String

10 REPLIES 10
ShankerV
17 - Castor

Hi @Alteryxexpert 

 

It can be achieved with the below steps.

 

Step 1: RecordID tool

 

Step 2: Sort tool

 

Step 3: Formula tool

 

Step 4: Select tool

 

Step 5: Multi-Row Formula tool

 

Step 6: Sort tool

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @Alteryxexpert 

 

Please find the detailed steps if more assistance is needed to the above response.

 

Step 1: RecordID tool

 

Step 2: Sort tool

Name -> Ascending

RecordID -> Descending

 

Step 3: Formula tool

Output column: 31-Dec-23

ToString(ToNumber([31-Dec-23]))

 

Step 4: Select tool

Convert Type of column Split and 31-Dec-23 as Double

 

Step 5: Multi-Row Formula tool

Update Existing Field: Split

 

IF [item] = [Row-1:item]
THEN [31-Dec-23] + [Row-1:31-Dec-23]
ELSE [31-Dec-23]
ENDIF

 

Step 6: Sort tool

RecordID -> Ascending

 

Hope this helps!!!

 

Many thanks

Shanker V

Alteryxexpert
8 - Asteroid

can you give it in the workflow please?

ShankerV
17 - Castor

Hi @Alteryxexpert 

 

Apologies, could not upload the workflow due to some error.

Please do replicate the above steps as it worked.

 

Many thanks

Shanker V

aatalai
14 - Magnetar

@Alteryxexpert does the workflow attached help?

Alteryxexpert
8 - Asteroid

 column name will change for upcoming months, currently it is 31-Dec-2023, next it will be 01-Jan-2024 ,02-Feb-2024 and so on, and this calculation needs to be dynamic

Alteryxexpert
8 - Asteroid

Also Is there a way to achieve the same formula using the below data which is before transform,

 

sub itemitemSplitValueDate
Chair_4Chair 790,00012/31/2023
Chair_3Chair 45,45412/31/2023
Chair_2Chair 77755512/31/2023
Chair_1Chair 565,66612/31/2023
Chair_0Chair 888,99912/31/2023
Chair_4Chair 790,0001/1/2024
Chair_3Chair 45,4541/1/2024
Chair_2Chair 7775551/1/2024
Chair_1Chair 565,6661/1/2024
Chair_0Chair 888,9991/1/2024

 

if this is achievable then the workflow will work dynamically

aatalai
14 - Magnetar

@Alteryxexpert this might help with the pre change

Alteryxexpert
8 - Asteroid

Values are numeric here, in your workflow it is string, I can't use replace on top of a numeric field also can't convert to str

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels