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!
Solved! Go to Solution.
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.
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
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
Dan
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:
Desired Output:
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |