Skip to content

Change the Expression of a (existing) field Parameter Table via script #1403

Discussion options

You must be logged in to vote

oh I see - you didn't mention that you got an error message in your original post - so I just assumed the script ran without error but didn't change anything.

In any case, it's an easy fix. You just need to explicitly cast the table to type CalculatedTable before attempting to access the Expression property. Like so:

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

// Explicit cast to CalculatedTable should let you assign the Expression property:
(targetTable as CalculatedTable).Expression = MyNewExpression ;

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@NaHolla
Comment options

@NaHolla
Comment options

@otykier
Comment options

Answer selected by NaHolla
@NaHolla
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants