Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Multiple Condition of Data addition and minus

SH_94
11 - Bolide

Hi Community,

 

I would like to ask how we can build the workflow so that it able produce the result as per screenshot below. I have few condition in order to achieve the final result:

1. I would like to join the data A and data B before performing data addition or data minus.

2. Once it is combined, i have the criteria as below:

   - If type is A, the amount from data A will be add together with amount from data B

   - If type is B and C, the amount from data A will minus the amount from data B

   - If type is D , the amount from data A will be add together with the amount from data B

 

 

I know how to build the step 1 in this case, but i not sure how to build the workflow for the second step.I also included the excel file below for your reference

Jacob_66_0-1616519915308.png

 

10 REPLIES 10
AngelosPachis
16 - Nebula

Hi @SH_94 ,

 

For point 1 : Please refer to the following thread, that explains what // stand for in an expression

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/DIfferent-exchange-rate-applied-to-the...

 

(it's a way for me to show you which part of the expression corresponds to each point of your question)

 

For point 2: You have to use an ELSE statement to exit the IF statement. I used Null() as a way to flag the subtype values that are not currently defined by the IF statement. Alternatively, you could do

 

 

IF [Subtype]="AA" THEN [Amount]-[Amount Data B]
ELSE [Amount]+[Amount Data B]
ENDIF

 

 

but if in the future you have another subtype [AC] that will automatically acquire the value of [Amount]+[Amount Data B] although you may not want to.

 

For point 3: Please refer to the following thread :

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/CONVERT-STRING-TO-DATE-FORMAT/m-p/7290...

 

Let me know if you have any further questions. Did anything from the posts provided above helped you answer that initial question or there is still something unclear?

 

Thanks,

 

Angelos

 

Labels
Top Solution Authors