diff --git a/BismNormalizer/BismNormalizer.CommandLine/Properties/AssemblyInfo.cs b/BismNormalizer/BismNormalizer.CommandLine/Properties/AssemblyInfo.cs index 0398284..9794cff 100644 --- a/BismNormalizer/BismNormalizer.CommandLine/Properties/AssemblyInfo.cs +++ b/BismNormalizer/BismNormalizer.CommandLine/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.0.19")] -[assembly: AssemblyFileVersion("4.0.0.19")] +[assembly: AssemblyVersion("4.0.0.20")] +[assembly: AssemblyFileVersion("4.0.0.20")] diff --git a/BismNormalizer/BismNormalizer.IconSetup/Properties/AssemblyInfo.cs b/BismNormalizer/BismNormalizer.IconSetup/Properties/AssemblyInfo.cs index 7e1763a..11dca95 100644 --- a/BismNormalizer/BismNormalizer.IconSetup/Properties/AssemblyInfo.cs +++ b/BismNormalizer/BismNormalizer.IconSetup/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.0.19")] -[assembly: AssemblyFileVersion("4.0.0.19")] +[assembly: AssemblyVersion("4.0.0.20")] +[assembly: AssemblyFileVersion("4.0.0.20")] diff --git a/BismNormalizer/BismNormalizer/Properties/AssemblyInfo.cs b/BismNormalizer/BismNormalizer/Properties/AssemblyInfo.cs index e65f9da..e409117 100644 --- a/BismNormalizer/BismNormalizer/Properties/AssemblyInfo.cs +++ b/BismNormalizer/BismNormalizer/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.0.19")] -[assembly: AssemblyFileVersion("4.0.0.19")] +[assembly: AssemblyVersion("4.0.0.20")] +[assembly: AssemblyFileVersion("4.0.0.20")] diff --git a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Measure.cs b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Measure.cs index b05f977..67fd945 100644 --- a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Measure.cs +++ b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Measure.cs @@ -85,7 +85,9 @@ namespace BismNormalizer.TabularCompare.TabularMetadata if (openSquareBracketPosition < closeSquareBracketPosition - 1) { string potentialDependency = whatsRemainingOfLine.Substring(openSquareBracketPosition + 1, closeSquareBracketPosition - openSquareBracketPosition - 1); - if (!potentialDependency.Contains('"') && !dependencies.Contains(potentialDependency)) + if (!potentialDependency.Contains('"') && + !_tomMeasure.Expression.Contains($"\"{potentialDependency}\"") && //it's possible the measure itself is deriving the column name from an ADDCOLUMNS for example + !dependencies.Contains(potentialDependency)) { //unbelievable: some genius at m$ did a replace on ] with ]] dependencies.Add(potentialDependency); @@ -106,7 +108,7 @@ namespace BismNormalizer.TabularCompare.TabularMetadata foreach (Table table in _parentTable.ParentTabularModel.Tables) { //Check if another measure or column has same name - if (table.Measures.ContainsName(dependency) || table.TomTable.Columns.ContainsName(dependency)) + if (table.Measures.ContainsNameCaseInsensitive(dependency) || table.ColumnsContainsNameCaseInsensitive(dependency)) { foundDependency = true; break; diff --git a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/MeasureCollection.cs b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/MeasureCollection.cs index e51c5bb..a53a5a6 100644 --- a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/MeasureCollection.cs +++ b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/MeasureCollection.cs @@ -42,6 +42,23 @@ namespace BismNormalizer.TabularCompare.TabularMetadata return false; } + /// + /// A Boolean specifying whether the collection contains object by name searching without case sensitivity. + /// + /// + /// True if the object is found, or False if it's not found. + public bool ContainsNameCaseInsensitive(string name) + { + foreach (Measure measure in this) + { + if (measure.Name.ToUpper() == name.ToUpper()) + { + return true; + } + } + return false; + } + /// /// Returns a collection of Measure objects filtered by the parent table's name. /// diff --git a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Table.cs b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Table.cs index 26cac2d..a54db9f 100644 --- a/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Table.cs +++ b/BismNormalizer/BismNormalizer/TabularCompare/TabularMetadata/Table.cs @@ -405,6 +405,27 @@ namespace BismNormalizer.TabularCompare.TabularMetadata #endregion + #region Other public methods + + /// + /// A Boolean specifying whether the table contains a column with the same name searching without case sensitivity. + /// + /// The name of the column being searched for. + /// True if the object is found, or False if it's not found. + public bool ColumnsContainsNameCaseInsensitive(string columnName) + { + foreach (Column column in _tomTable.Columns) + { + if (column.Name.ToUpper() == columnName.ToUpper()) + { + return true; + } + } + return false; + } + + #endregion + public override string ToString() => this.GetType().FullName; } } diff --git a/BismNormalizer/BismNormalizer/source.extension.vsixmanifest b/BismNormalizer/BismNormalizer/source.extension.vsixmanifest index c3b3cd0..2b5d9bd 100644 --- a/BismNormalizer/BismNormalizer/source.extension.vsixmanifest +++ b/BismNormalizer/BismNormalizer/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + BISM Normalizer BISM Normalizer manages Analysis Services tabular models http://bism-normalizer.com/