Alteryx Designer Desktop Discussions

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

A method of calculating values under special conditions

phoebe_90
8 - Asteroid

When Document Number and Tax Code is the same, this type of row is greater than 2, How do I make the value of the last row equal to the value of the corresponding "Amount in local currency" minus the value of the "Amount" column in the previous rows?

Amount=Amount in local currency*percentage

For example, change sheet1 to sheet2.

sheet1

Document NumberTax CodeAccountInput_#2_AccountAmount in local currencypercentageAmount
19000498J224508210660200000.4510.45
19000477J12450821065040000376.421376.42
19000477J224508210650100001061.440.33350.28
19000477J224508210650100001061.440.33350.28
19000477J224508210650100001061.440.34360.89
19000471J224508210660200008.4918.49
19000498J12450821066020000107.11107.1
19000471J12450821066020000191.441191.44

Sheet 2

Document NumberTax CodeAccountInput_#2_AccountAmount in local currencypercentageAmount
19000498J224508210660200000.4510.45
19000477J12450821065040000376.421376.42
19000477J224508210650100001061.440.33350.28
19000477J224508210650100001061.440.33350.28
19000477J224508210650100001061.440.34360.88
19000471J224508210660200008.4918.49
19000498J12450821066020000107.11107.1
19000471J12450821066020000191.441191.44
4 REPLIES 4
ShankerV
17 - Castor

Hi @phoebe_90 

 

One way of doing this.

 

ShankerV_0-1680599383594.png

 

Note: Use select tool to remove the record id column and temp column which is used for calculation purpose.

 

Many thanks

Shanker V

phoebe_90
8 - Asteroid

Is there a formula for that last row? If the row is not always equal 3.

OllieClarke
15 - Aurora
15 - Aurora

Hi @phoebe_90 

 

This approach will update the final row (assuming there's more than 1 row) to minus all previous rows from the amount in local currency; otherwise it will leave the rows alone. 

This will be dynamic for any number of rows.

OllieClarke_0-1680607538018.png

Hope that helps,

 

Ollie

 

ShankerV
17 - Castor

Hi @phoebe_90 

 

Please find the modified workflow to accommodate the request which will work DYNAMICALLY where there might be more than 3 rows of same Document number and Tax code.

 

ShankerV_0-1680609806133.png

 

Many thanks

Shanker V

 

Labels