Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Subtract two columns based on criteria

dsevilimedu
7 - Meteor

Hi,

I am trying to find a way to calculate difference between two columns based on 2 criterias - 1) Product 2) Month. The output I am looking for alteryx to do is add a column, and subtract values. For example: The difference between price 1 and price 2 is 100 for period 1, for product 123456, -900 for blanks, 400 for period 2, 500 for period 3. My dataset, unfortunately, is arranged this way. Perhaps, something to do with Transpose, Multi-Row and Cross Tab? there might be a better solution? Thanks! 

 

dsevilimedu_0-1677643010602.png

 

Output

 

dsevilimedu_1-1677643259165.png

 

 

3 REPLIES 3
apathetichell
20 - Arcturus

summarize tool. group by category, product, month. sum price 1, sum price 2. formual tool for new column delta sum price 1- sum price 2.

niteshsharma677
7 - Meteor

Hi @dsevilimedu 

I have attached a possible solution.

 

Regards,

Nitesh

flying008
15 - Aurora

Hi, @dsevilimedu 

 

Please see that below:

 

录制_2023_03_01_13_34_13_790.gif

 

******

If it can help you , please mark it as a solution and give a like for more share.

 

 

Labels
Top Solution Authors