Create 1000 columns with similar formulas at one runI have an input column (ColumnA) that essentially has the Index of the table. I want to add 1000 numeric columns to this table. Each of the columns will add the column number to the original column.
Example: the first new column will have the formula, ColumnA+1.
30th new column will have the formula, ColumnA+30.
Automation and ScriptingBasic Data Analysis and ModelingWindowsRe: Create 1000 columns with similar formulas at one run1. make 100 columns.
2. select all 100 columns
3. Cols>Standardize attibutes
4. Add a formula column property from the properties dropdown.
5. Edit the formula, put in your formula, and click OK in the formula editor
6. Finally click ok (top right of standardize attributes window)
but I'm not sure that's what you really want to do
Re: Create 1000 columns with similar formulas at one runIf you really need formulas and not just values, here is one option
Names Default To Here(1);
dt = New Table("test",
Add Rows(2),
New Column("ColumnA", Numeric, Continuous, Values([1, 2])),
Invisible // open/create as invisible! (or make invisible)
);
For(i = 1, i <= 1000, i++,
Eval(EvalExpr(
dt << New Column("ColumnA+"||Char(i), Numeric, Continuous, Formula(
:ColumnA + Expr(i)
))
));
);
dt << Show Window(1); // if you need table visible later
If speed is important using Invisible is one thing you can do.