I have data like below, where for each time period the columns will get changed to different quarters, Q1'23 to Q2'23 & Q1'24 to Q2'24.
A | B | C | D | E | F | G | H |
Currency | Q1'23 | Q1'24 | Q1'24 vs Q1'23 | Q1'24 vs Q1'23% | Q1_23 | Q1_24 | Inflation |
TND | 828 | 751 | -77 | -9% | 104 | 4 | 100 |
INR | 961 | 654 | -307 | -32% | |||
GBP | 1788 | 1405 | -383 | -21% | 104 | 4 | 100 |
JPY | 704 | 881 | 177 | 25% | 125 | ||
SGP | 2492 | 2287 | -205 | -8% | 104 | 129 | -25 |
EUR | 212 | 149 | -63 | -30% | |||
CNY | 51 | 67 | 16 | 31% | |||
RUB | 340 | 401 | 61 | 18% | |||
LKR | 603 | 617 | 14 | 2% | |||
SEK | 34 | 41 | 7 | 21% | |||
CHF | 441 | 382 | -59 | -13% | |||
THB | 474 | 423 | -51 | -11% | |||
USD | 3569 | 3328 | -241 | -7% | 104 | 129 | -25 |
I want the output like below which needs to be calculated dynamically whenever the columns are getting changed, Columns I,J,K,L needs to be calculated dynamically based on the previous columns.
A | B | C | D | E | F | G | H | I | J | K | L |
Currency | Q1'23 | Q1'24 | Q1'24 vs Q1'23 | Q1'24 vs Q1'23% | Q1_23 | Q1_24 | Inflation | Q1'23 | Q1'24 | Q1'24 vs Q1'23 | Q1'24 vs Q1'23% |
TND | 828 | 751 | -77 | -9% | 104 | 4 | 100 | B3-F3 | C3-G3 | J3-I3 | Difference in % Between Column J & I |
INR | 961 | 654 | -307 | -32% | B4-F4 | C4-G4 | J4-I4 | Difference in % Between Column J & I | |||
GBP | 1788 | 1405 | -383 | -21% | 104 | 4 | 100 | B5-F5 | C5-G5 | J5-I5 | Difference in % Between Column J & I |
JPY | 704 | 881 | 177 | 25% | 125 | B6-F6 | C6-G6 | J6-I6 | Difference in % Between Column J & I | ||
SGP | 2492 | 2287 | -205 | -8% | 104 | 129 | -25 | B7-F7 | C7-G7 | J7-I7 | Difference in % Between Column J & I |
EUR | 212 | 149 | -63 | -30% | B8-F8 | C8-G8 | J8-I8 | Difference in % Between Column J & I | |||
CNY | 51 | 67 | 16 | 31% | B9-F9 | C9-G9 | J9-I9 | Difference in % Between Column J & I | |||
RUB | 340 | 401 | 61 | 18% | B10-F10 | C10-G10 | J10-I10 | Difference in % Between Column J & I | |||
LKR | 603 | 617 | 14 | 2% | B11-F11 | C11-G11 | J11-I11 | Difference in % Between Column J & I | |||
SEK | 34 | 41 | 7 | 21% | B12-F12 | C12-G12 | J12-I12 | Difference in % Between Column J & I | |||
CHF | 441 | 382 | -59 | -13% | B13-F13 | C13-G13 | J13-I13 | Difference in % Between Column J & I | |||
THB | 474 | 423 | -51 | -11% | B14-F14 | C14-G14 | J14-I14 | Difference in % Between Column J & I | |||
USD | 3569 | 3328 | -241 | -7% | 104 | 129 | -25 | B15-F15 | C15-G15 | J15-I15 | Difference in % Between Column J & I |
How to achieve this in alteryx?
You can bring the data in with the selection in the input tool for "First row contains data". That will make the column names generic and you can refer to [Field3] or similar.
That will help you with this specific request, however I expect that you could automate more of this process that would make this part easier. Whether that be by transposing the data to reference generic columns, or constructing those variances in the same process. Maybe a separate line for each quarter.
The input data is the ouput of previous steps inside the alteryx workflow, this will be the last step of my alteryx workflow that i'm developing.
OK, if the data is already in, then you've got to make the field names generic so they can be referenced.
You can do this several ways.
An easy/quick way would be to use a field info tool, apply a recordID, use a formula to create the generic field names for row 2/3/6/7 and then a dynamic rename. This can also be done in reverse.
Mocked up below:
This is Not working for my Case, Is there any alternate solution can we have if any?
There's several ways to do it, but if that above solution is not working then there's something else at play. And without the required reasons for why it's not working, I don't know what that is.