NaHolla
NaHolla

Reputation: 103

Tabular Editor: Change the Expression of a field Parameter Table / calculated Table via script

I have a table which is defind as a field Parameter (which I've customized)

TableName = "TOP-Kategorie"

Now, I'd like to update the expression

var targetTable = Model.Tables["TOP-Kategorie"];

var MyNewExpression = ReadFile(@"U:...\TabularMeasures\TOP-Kategorie.csv"); // this works

targetTable.Expression = MyNewExpression ; //not working

enter image description here

how do I change the exression? Thanks!

Upvotes: 2

Views: 39

Answers (1)

Jzrzmy
Jzrzmy

Reputation: 331

You probably need to specify that's a calculated table you are dealing with. This works:

foreach (var t in Selected.CalculatedTables)
{
    t.Expression = "{...}";
}

Upvotes: 0

Related Questions