Create "Source Table" Column in Table that references Data Table NameHi!
I'd like to create a column called "Source Table" that auto populates with the name of data table that is being worked on.
This is done when concatenating multiple file names; but I'd like to do it at the start of all my workflows as a matter of practice (without having to manually add it).
Is this possible?
Thanks!
Katie
Mass CustomizationRe: Create "Source Table" Column in Table that references Data Table NameYou could at least add a small script to perform that column creation. Here is one option for that
</CODE><CODE class=" language-jsl">Local({dt, newcol},
dt = Current Data Table();
If(!Contains(dt << Get Column Names("String"), "Source"),
newcol = dt << New Column("Source", Character, Nominal, Formula(
dt << get name;
));
dt << Run Formulas;
newcol << Delete Formula;
);
);
(I added If statement to avoid re-creation of the column if Source column already exists, but you can drop it if it isn't needed)
Re: Create "Source Table" Column in Table that references Data Table NameAlso in this case you can use Set Each Value, it makes the script a bit simpler
Local({dt, newcol},
dt = Current Data Table();
If(!Contains(dt << Get Column Names("String"), "Source"),
newcol = dt << New Column("Source", Character, Nominal, Set Each Value(
dt << get name;
));
);
);Re: Create "Source Table" Column in Table that references Data Table NameHere is a Work Flow step that can be added that adds the Source Table column to the current data table


Re: Create "Source Table" Column in Table that references Data Table NameThank you!!!
This solves my problem beautifully!
Re: Create "Source Table" Column in Table that references Data Table NameThank you!! I am stepping away from standalone scripts & into the world of workflows! This will be helpful!