Header preparation
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 :
Filename | PRODUCT_BRAND | Sum_Sum_w1 | Sum_Sum_w2 | Sum_Sum_w3 | Sum_Sum_w4 |
cos_prj_rxdx_cnt_20161104 | A | 0 | 1 | 0 | 0 |
cos_prj_rxdx_cnt_20161104 | B | 3 | 2 | 1 | 0 |
cos_prj_rxdx_cnt_20161104 | C | 4 | 3 | 5 | 3 |
Output :
Filename | PRODUCT_BRAND | 04/11/2016 | 28/10/2016 | 21/10/2016 | 14/10/2016 |
cos_prj_rxdx_cnt_20161104 | A | 0 | 1 | 0 | 0 |
cos_prj_rxdx_cnt_20161104 | B | 3 | 2 | 1 | 0 |
cos_prj_rxdx_cnt_20161104 | C | 4 | 3 | 5 | 3 |
Let me know if i am not clear with the above question.
TIA
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Its works great, Thanks.
