Alteryx Designer Desktop Discussions

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

Adding new columns (of blank data) for each column formatted as date

michalikm
7 - Meteor

Hello!
I have what probably will sound complex, but I hope is a simple question. I'm looking to create a workflow that takes an input file, with a varying number of columns, some of which having date formatted headers. Within the workflow, I'd like to be able to add an additional column to the dataset, for each column that has a date header. I tried searching through the forums to see if I could find a similar ask, but wasn't able to find anything that met my ask. Any advice/tips would be greatly appreciated!

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@michalikm 

Maybe we can use the Transpose and Crosstab tool to create the new columns,

Below is the sample.

If you could provdide some sample data and desired output, we can give a close look.

CA1.PNG

danilang
19 - Altair
19 - Altair

Hi @michalikm 

 

Since you want to add new empty columns to your data set, you can get an answer by manipulating the metadata of your input as opposed to manipulating the data

danilang_1-1615642350066.png

 

 

Use a field info tool to get the field names and then increase the length of the name column. Filter out the date columns.  in my case I looked for any field that contains "-" in the name.  You'll need to tailor this to your particular data.  Add new to the name and crosstab.  The Sample tool sample the 0th first rows so get only the header.  Append the new fields to the existing data set and the new columns are automatically filled with null values

 

danilang_2-1615642568561.png

 

Dan

 

michalikm
7 - Meteor

Thank you both for the quick replies! The solution using the field info tool might be close to what I'm looking for, but since it was requested, I'll supply a sample of what my input and desired output should look like. I'll give the field info tool a shot and see if that allows me to accomplish this and reply back!

Input Data:

michalikm_2-1615815339521.png

 

 

Desired Output:

michalikm_1-1615815261295.png

 

Labels