Example #1
0
 public void AddUserHierarchy(Table daxTable, Tom.Hierarchy hierarchy)
 {
     Dax.Model.UserHierarchy daxUserHierarchy = new Dax.Model.UserHierarchy(daxTable)
     {
         HierarchyName = new Dax.Model.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.Model.Column levelColumn = daxTable.Columns.Find(t => t.ColumnName.Name == level.Column.Name);
         daxUserHierarchy.Levels.Add(levelColumn);
     }
     daxTable.UserHierarchies.Add(daxUserHierarchy);
 }
Example #2
0
        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.Model.UserHierarchy(daxTable)
                {
                    HierarchyName = new Dax.Model.DaxName(userHierarchyName)
                };
            }

            return(daxUserHierarchy);
        }
Example #3
0
 internal VpaUserHierarchy(Dax.Model.UserHierarchy userHierarchy)
 {
     this.UserHierarchy = userHierarchy;
 }
Example #4
0
 internal UserHierarchy(Dax.Model.UserHierarchy userHierarchy)
 {
     _UserHierarchy = userHierarchy;
 }