Alteryx Designer Desktop Discussions

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

Runtime creation of Columns name using Cross Tab

sneha_bhiwagade1
8 - Asteroid

Hi

From my first WF I am passing year as control parameter to my second WF.

In my second WF I am validating condition in formula tool.

IIF([Year]=[#1]-1,"MTD_N-1"+"_"+"Month_No","") And [#1] is nothing but the year number coming from 1st WF that is through control parameter.

Based on Formula tool output I am getting values as example "MTD_N-1_01" upto "MTD_N-1_12".

After that I am using cross tab tool to give "MTD_N-1_01" up to "MTD_N-1_12" as column name. Issue I am facing with cross tab that it converts "MTD_N-1_01" to "MTD_N_1_01".

By any luck i managed to solve the issue of cross tab with the available solutions on community using Dynamic rename.

But later my issue is that based on my input file I need the output in sequence of input and later the "MTD" columns mentioned in screenshot as "desired output".

But I am getting "MTD" column's as first and input file columns after that. 

I had provided the dummy data. Any suggestions or example please. Thanks in Advance..

 

Second WF InputSecond WF InputDesired OutputDesired Output

3 REPLIES 3
DavidP
17 - Castor
17 - Castor

Does this help you? You can the 1st 4 columns back to the crosstab result with an append fields or join tool, whichever suits your application best. You can then control the column order like in any tool with select functionality.

 

MTD.png

 

sneha_bhiwagade1
8 - Asteroid

Thanks David for your solution. It's working perfectly. What if I need the values of Profit in each of the respective "MTD_N-1" columns. Thanks in advance..........

DavidP
17 - Castor
17 - Castor

You could do this with the multi-field formula tool:

 

MTD.png

Labels