m-kovalsky / Tabular

Useful code for tabular modeling and automation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to create parameters/shared expression?

pawarbi opened this issue · comments

Hi Michael - thanks so much for your scripts. I use several of them and save me a lot of time and efforts.

Is there a way to create parameters in TE using scripts? I was able to create Shared expression but couldn't figure out how to set the kind to M and add Expression via script.

Thanks

You can use this as an example. Also, you can use this documentation as a reference:

https://docs.microsoft.com/dotnet/api/microsoft.analysisservices.tabular.namedexpression.kind?view=analysisservices-dotnet

Model.AddExpression("hello");
Model.Expressions["hello"].Kind = ExpressionKind.M;