Forum Discussion
How to replace text in Bulk for Calculated Columns -- Tabular Editor
- 3 years ago
Hey dbernabefdez
After looking at the documentation and doing an example you should try the following code
var FromString = "Text1";
var ToString = "Text2";foreach(var c in Selected.CalculatedColumns)
{
c.Expression = c.Expression.Replace(FromString,ToString);
/* Cycle over all measures in model and replaces the
FromString with the ToString */
}Hope it works for you.
Cheers, LQ
Hey dbernabefdez
After looking at the documentation and doing an example you should try the following code
var FromString = "Text1";
var ToString = "Text2";
foreach(var c in Selected.CalculatedColumns)
{
c.Expression = c.Expression.Replace(FromString,ToString);
/* Cycle over all measures in model and replaces the
FromString with the ToString */
}
Hope it works for you.
Cheers, LQ
- dbernabefdez3 years agoFrequent Visitor
WOUU incredible!!!! Works great
I was making the mistake of using ""foreach(var c in Selected.Columns)"" instead of ""foreach(var c in Selected.CalculatedColumns)""
Thank you so much for your help