Alteryx Designer Desktop Discussions

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

Multiply or Divide one column by the next one

vrebelo
5 - Atom

Greeting!

 

I'd like to know if there's a way, maybe using Multi-Field Formula Tool, to divide one specific column to the next(or previous) one, here is an example:

 

 

example1.PNG

 

 

I want to create a new column for each month, with the ratio Tax/Value, so it would look like this:

 

 

example2.PNG

 

 

I know I can do it using Formula tool, but the only way I know how to do it is by creating 1 formula for each month, so if I get extended periods, years, I'd need to do numerous formulas. Is there a faster way of doing that?

 

Thanks in advance!!

2 REPLIES 2
Luke_C
17 - Castor

Hi @vrebelo 

 

Might have overengineered this, but in order to avoid repeating formulas I prefer to transpose the data into fewer columns. The first portion of the attached transposes the data into 3 main columns: Month, Tax, and Value. Then we calculate the ratio just once based on the columns and get it back into your desired format.

 

 

Luke_C_0-1621611749440.png

 

 

vrebelo
5 - Atom

Thank you, @Luke_C!! I'll try it out!

Labels