diff --git a/Basic/Hide columns on the many side of a relationship.csx b/Basic/Hide columns on the many side of a relationship.csx index 8079b0f..8a80c30 100644 --- a/Basic/Hide columns on the many side of a relationship.csx +++ b/Basic/Hide columns on the many side of a relationship.csx @@ -6,6 +6,10 @@ * it is dangerous to use columns on the many side of a relationship as it can * produce unexpected results, so it is a best practice to hide these columns * to discourage their use in reports. + * + * This script does not play well with Auto Calendar Tables (because your Calendar Date + * column is technically on the many side of the hidden Auto Calendar Tables. + * Make sure you turn off Auto Calendar Tables first before using this script. */ // Hide all columns on many side of a join diff --git a/Intermediate/Replace Text Strings that appear in many measures.csx b/Intermediate/Replace Text Strings that appear in many measures.csx new file mode 100644 index 0000000..f47fd0a --- /dev/null +++ b/Intermediate/Replace Text Strings that appear in many measures.csx @@ -0,0 +1,17 @@ +/* + * Title: Replace Text Strings that appear in many measures + * + * Author: Matt Allington http://xbi.com.au + * + * This script, when executed, will loop through the currently selected measures + * and replace the FromString with the ToString. + */ + +/ Replace Text Strings that appear in many measures + var FromString = "CALCULATE(SUM(Sales[ExtendedAmount])"; + var ToString = "CALCULATE([Total Sales]"; + foreach (var m in Model.AllMeasures) + { + m.Expression = m.Expression.Replace(FromString,ToString); + } +