public void AddUserHierarchy(Table daxTable, Tom.Hierarchy hierarchy) { Dax.Metadata.UserHierarchy daxUserHierarchy = new Dax.Metadata.UserHierarchy(daxTable) { HierarchyName = new Dax.Metadata.DaxName(hierarchy.Name), IsHidden = hierarchy.IsHidden, }; // Create the hierarchy from the top to the bottom level foreach (var level in hierarchy.Levels.OrderBy(t => t.Ordinal)) { Dax.Metadata.Column levelColumn = daxTable.Columns.Find(t => t.ColumnName.Name == level.Column.Name); daxUserHierarchy.Levels.Add(levelColumn); } daxTable.UserHierarchies.Add(daxUserHierarchy); }
private UserHierarchy GetDaxUserHierarchy(string tableName, string userHierarchyName) { var daxTable = GetDaxTable(tableName); var daxUserHierarchy = daxTable.UserHierarchies.Where(h => h.HierarchyName.Name == userHierarchyName).FirstOrDefault(); if (daxUserHierarchy == null) { daxUserHierarchy = new Dax.Metadata.UserHierarchy(daxTable) { HierarchyName = new Dax.Metadata.DaxName(userHierarchyName) }; } return(daxUserHierarchy); }
internal UserHierarchy(Dax.Metadata.UserHierarchy userHierarchy) { _UserHierarchy = userHierarchy; }
internal VpaUserHierarchy(Dax.Metadata.UserHierarchy userHierarchy) { this.UserHierarchy = userHierarchy; }