Alteryx Designer Desktop Discussions

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

Header preparation

harsha384
Asteroid

Hi All,

 

I have a query regarding header preparation of the data. I have filename column which contain reference date value(Can be extracted through trim).Using it i need to rename my columns for last 27 weeks.

For example : Column name should be -- Sum_Sum_w1= 04-11-2016, Sum_Sum_w2=28-10-2016 and so on...

Note :

The column name should be dynamic. It should automatically pickup the reference date from the filename column and rename the column name with the last 27 weeks.

 

Input :

 

FilenamePRODUCT_BRANDSum_Sum_w1Sum_Sum_w2Sum_Sum_w3Sum_Sum_w4
cos_prj_rxdx_cnt_20161104A0100
cos_prj_rxdx_cnt_20161104B3210
cos_prj_rxdx_cnt_20161104C4353

 

Output :

 

FilenamePRODUCT_BRAND04/11/201628/10/201621/10/201614/10/2016
cos_prj_rxdx_cnt_20161104A0100
cos_prj_rxdx_cnt_20161104B3210
cos_prj_rxdx_cnt_20161104C4353

 

Let me know if i am not clear with the above question.

 

TIA

Harsh

4 ANTWORTEN 4
scottj
Alteryx Alumni (Retired)

I built an example using the Date/Time formulas, Dymanic Rename and Dynamic select to build out the headers and replace.  Let us know if this works for you.

 

DynamicHeaders.png

Scott Jones
Strategic Sales Engineer
Alteryx, Inc.
sgwong
Asteroid

Seek your advice on dynamic rename header on date format only.

 

Input Data:

sgwong_0-1676351849185.jpeg

 

 

Output Data:

sgwong_1-1676351849170.jpeg

 

 

apathetichell
Pollux

dynamic rename - formula mode- select all make - sure dynamic and unknown fields are checked.

 

if regex_match([_CurrentField_],"\d{4}-\d{2}-\d{2}") then datetimeformat(todate([_CurrentField_]),"%b-%y") else [_CurrentField_] endif

 

this says - if my field name is four numbers-two numbers-twon umbers convert it to a date and then give me month-yy else - keep it the same name.

 

 

 

sgwong
Asteroid

Its works great, Thanks.

Beschriftungen