Beispiel #1
0
        internal new IEnumerable <MeasureGroupRow> Discover(IEnumerable <IFilter> filters)
        {
            var measureGroups = new List <MeasureGroupRow>();

            Inform("Investigating measure-groups");

            using (var cmd = CreateCommand())
            {
                var adomdFiltering = Build(filters);
                cmd.CommandText = string.Format("SELECT * FROM $system.mdschema_measures WHERE MEASURE_IS_VISIBLE{0}", adomdFiltering);
                var rdr = ExecuteReader(cmd);

                while (rdr.Read())
                {
                    var row = MeasureGroupRow.Load(rdr);
                    if (row != null)
                    {
                        if (!measureGroups.Exists(mg => mg.Name == row.Name && mg.PerspectiveName == row.PerspectiveName))
                        {
                            measureGroups.Add(row);
                        }
                    }
                }
            }

            return(measureGroups);
        }
Beispiel #2
0
        public static MeasureGroupRow Load(AdomdDataReader dataReader)
        {
            // Traverse the response and
            // Traverse the response and
            // read column 2, "CUBE_NAME"

            // Get the column value
            string perspectiveName = (string)dataReader.GetValue(2);

            if (!perspectiveName.StartsWith("$"))
            {
                var row = new MeasureGroupRow();

                if (dataReader.FieldCount == 11)
                {
                    // read column 18, "MEASUREGROUP_NAME"
                    // read column 5, "DIMENSION_UNIQUE_NAME"
                    // read column 7, "DIMENSION_IS_VISIBLE"
                    // Get the column value
                    row.PerspectiveName = perspectiveName;
                    row.Name            = (string)dataReader.GetValue(3);

                    //Check if the linked dimension is visible
                    if ((bool)dataReader.GetValue(7))
                    {
                        row.LinkedDimensionUniqueName = (string)dataReader.GetValue(5);
                    }
                    return(row);
                }
                else
                {
                    // read column 18, "MEASUREGROUP_NAME"
                    // Get the column value
                    row.PerspectiveName = perspectiveName;
                    row.Name            = (string)dataReader.GetValue(18);
                }

                return(row);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public static MeasureGroupRow Load(AdomdDataReader dataReader)
        {
            // Traverse the response and
            // Traverse the response and
            // read column 2, "CUBE_NAME"

            // Get the column value
            string perspectiveName = (string)dataReader.GetValue(2);
            if (!perspectiveName.StartsWith("$"))
            {
                var row = new MeasureGroupRow();

                if (dataReader.FieldCount == 11)
                {
                    // read column 18, "MEASUREGROUP_NAME"
                    // read column 5, "DIMENSION_UNIQUE_NAME"
                    // read column 7, "DIMENSION_IS_VISIBLE"
                    // Get the column value
                    row.PerspectiveName = perspectiveName;
                    row.Name = (string)dataReader.GetValue(3);

                    //Check if the linked dimension is visible
                    if ((bool)dataReader.GetValue(7))
                        row.LinkedDimensionUniqueName = (string)dataReader.GetValue(5);
                    return row;

                }
                else
                {
                    // read column 18, "MEASUREGROUP_NAME"
                    // Get the column value
                    row.PerspectiveName = perspectiveName;
                    row.Name = (string)dataReader.GetValue(18);
                }

                return row;
            }
            else
                return null;
        }
        internal IEnumerable <MeasureGroupRow> Discover(IEnumerable <IFilter> filters)
        {
            var measureGroups = new List <MeasureGroupRow>();

            Inform("Investigating links to a dimension");

            using (var cmd = CreateCommand())
            {
                var adomdFiltering = Build(filters);
                cmd.CommandText = string.Format("SELECT * FROM $system.mdschema_measuregroup_dimensions WHERE DIMENSION_IS_VISIBLE{0}", adomdFiltering);
                var rdr = ExecuteReader(cmd);

                while (rdr.Read())
                {
                    var row = MeasureGroupRow.Load(rdr);
                    if (row != null)
                    {
                        measureGroups.Add(row);
                    }
                }
            }

            return(measureGroups);
        }