Exemple #1
0
        public void ParseAll()
        {
            #region Arrange

            var singDic = new Dictionary <string, string>();
            singDic.Add("[Usage].[Inbound or Outbound].[Inbound or Outbound]",
                        "[Usage].[Inbound or Outbound].&[Inbound]");
            singDic.Add("[Usage].[Call Type].[Call Type]",
                        "[Usage].[Call Type].&[MOC]");
            singDic.Add("[UsageDate].[Usage_Year].[Usage_Year]",
                        "[UsageDate].[Usage_Year].&[2014]");
            singDic.Add("[UsageDate].[Usage_MonthAbbrev].[Usage_MonthAbbrev]",
                        "[UsageDate].[Usage_MonthAbbrev].&[May]");
            #endregion

            #region Parse
            string commandText;

            var pivotCellDic = new PivotCellDictionary();
            pivotCellDic.SingleSelectDictionary = singDic;

            using (var tabular = new DaxDrill.Tabular.TabularHelper(serverName, "Roaming"))
            {
                tabular.Connect();
                commandText = DaxDrillParser.BuildQueryText(tabular, pivotCellDic, "Gross Billed Sum", 99999);
                tabular.Disconnect();
            }
            #endregion

            #region Assert
            Console.WriteLine(commandText);

            #endregion
        }
Exemple #2
0
        public void ParseCellDictionary()
        {
            #region Arrange

            var excelDic = new Dictionary <string, string>();
            excelDic.Add("[Usage].[Inbound or Outbound].[Inbound or Outbound]",
                         "[Usage].[Inbound or Outbound].&[Inbound]");
            excelDic.Add("[Usage].[Call Type].[Call Type]",
                         "[Usage].[Call Type].&[MOC]");
            excelDic.Add("[UsageDate].[Usage_Year].[Usage_Year]",
                         "[UsageDate].[Usage_Year].&[2014]");
            excelDic.Add("[UsageDate].[Usage_MonthAbbrev].[Usage_MonthAbbrev]",
                         "[UsageDate].[Usage_MonthAbbrev].&[May]");
            #endregion

            #region Parse
            var pivotCellDic = new PivotCellDictionary();
            pivotCellDic.SingleSelectDictionary = excelDic;
            string commandText;
            using (var tabular = new DaxDrill.Tabular.TabularHelper(serverName, "Roaming"))
            {
                tabular.Connect();
                commandText = DaxDrillParser.BuildFilterCommandText(pivotCellDic, tabular, null);
                tabular.Disconnect();
            }
            #endregion

            #region Assert
            Console.WriteLine(commandText);

            #endregion
        }
Exemple #3
0
        public void GetMeasure_SSAS2016()
        {
            var tabular = new DaxDrill.Tabular.TabularHelper("FINSERV01", "HRR_Snap");

            tabular.Connect();
            TabularItems.Measure measure = tabular.GetMeasure("HRR_ExGST_Sum");
            Console.WriteLine(measure.Name);
        }
Exemple #4
0
        public void GetMeasure()
        {
            string measureName = "Gross Billed Sum";

            TabularItems.Measure measure = null;
            using (var tabular = new DaxDrill.Tabular.TabularHelper(serverName, "Roaming"))
            {
                tabular.Connect();
                measure = tabular.GetMeasure(measureName);
                tabular.Disconnect();
            }
            Console.WriteLine("Measure = {0}, Table = {1}", measure.Name, measure.TableName);
        }
Exemple #5
0
        public void ParseSelectedColumns()
        {
            #region Arrange

            var singDic = new Dictionary <string, string>();
            singDic.Add("[Usage].[Inbound or Outbound].[Inbound or Outbound]",
                        "[Usage].[Inbound or Outbound].&[Inbound]");
            singDic.Add("[Usage].[Call Type].[Call Type]",
                        "[Usage].[Call Type].&[MOC]");
            singDic.Add("[UsageDate].[Usage_Year].[Usage_Year]",
                        "[UsageDate].[Usage_Year].&[2014]");
            singDic.Add("[UsageDate].[Usage_MonthAbbrev].[Usage_MonthAbbrev]",
                        "[UsageDate].[Usage_MonthAbbrev].&[May]");
            #endregion

            #region Parse
            var pivotCellDic = new PivotCellDictionary();
            pivotCellDic.SingleSelectDictionary = singDic;

            var    parser = new DaxDrillParser();
            string commandText;
            using (var tabular = new DaxDrill.Tabular.TabularHelper(serverName, "Roaming"))
            {
                tabular.Connect();
                var selectedColumns = new List <DetailColumn>();
                selectedColumns.Add(new DetailColumn()
                {
                    Name = "Call Type", Expression = "Usage[Call Type]"
                });
                selectedColumns.Add(new DetailColumn()
                {
                    Name = "Call Type Description", Expression = "Usage[Call Type Description]"
                });
                commandText = DaxDrillParser.BuildQueryText(tabular, pivotCellDic, "Gross Billed Sum", 99999, selectedColumns, null);
                tabular.Disconnect();
            }
            #endregion

            #region Assert
            Console.WriteLine(commandText);

            #endregion
        }