How to use MembersCommand class of NBi.Core.Analysis.Member package

Best NBi code snippet using NBi.Core.Analysis.Member.MembersCommand

MembersCommandTest.cs

Source:MembersCommandTest.cs Github

copy

Full Screen

...8namespace NBi.Testing.Integration.Core.Analysis.Member9{10 [TestFixture]11 [Category ("Olap")]12 public class MembersCommandTest13 {14 [Test]15 public void List_Level_ListOfMembers()16 {17 var connStr = ConnectionStringReader.GetAdomd();18 var cmd = new MembersCommand(connStr, "Members", null);19 var filters = new List<CaptionFilter>(){ 20 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),21 new CaptionFilter("Date", DiscoveryTarget.Dimensions),22 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),23 new CaptionFilter("Month", DiscoveryTarget.Levels)24 };2526 var result = cmd.List(filters);27 Assert.That(result.Count, Is.EqualTo(72));28 }2930 [Test]31 public void List_Hierarchy_ListOfMembers()32 {33 var connStr = ConnectionStringReader.GetAdomd();34 var cmd = new MembersCommand(connStr, "Members", null);35 var filters = new List<CaptionFilter>(){ 36 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),37 new CaptionFilter("Date", DiscoveryTarget.Dimensions),38 new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies),39 };4041 var result = cmd.List(filters);42 Assert.That(result.Count, Is.EqualTo(13));43 }4445 [Test]46 public void List_LevelWithExclusionOfJanuary2005_ListOfMembers()47 {48 var connStr = ConnectionStringReader.GetAdomd();49 var excludedMembers = new List<string>() { "January 2005" };50 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, null);51 var filters = new List<CaptionFilter>(){ 52 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),53 new CaptionFilter("Date", DiscoveryTarget.Dimensions),54 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),55 new CaptionFilter("Month", DiscoveryTarget.Levels)56 };5758 var result = cmd.List(filters);59 Assert.That(result.Count, Is.EqualTo(71));60 }6162 [Test]63 public void List_LevelWithExclusionOfJanuary2005AndNovember2005_ListOfMembers()64 {65 var connStr = ConnectionStringReader.GetAdomd();66 var excludedMembers = new List<string>() { "January 2005", "November 2005" };67 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, null);68 var filters = new List<CaptionFilter>(){ 69 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),70 new CaptionFilter("Date", DiscoveryTarget.Dimensions),71 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),72 new CaptionFilter("Month", DiscoveryTarget.Levels)73 };7475 var result = cmd.List(filters);76 Assert.That(result.Count, Is.EqualTo(70));77 }7879 [Test]80 public void List_LevelWithExclusionOfJanuary2005AndNonExistingMember_ListOfMembers()81 {82 var connStr = ConnectionStringReader.GetAdomd();83 var excludedMembers = new List<string>() { "January 2005", "Non existing month 2005" };84 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, null);85 var filters = new List<CaptionFilter>(){ 86 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),87 new CaptionFilter("Date", DiscoveryTarget.Dimensions),88 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),89 new CaptionFilter("Month", DiscoveryTarget.Levels)90 };9192 var result = cmd.List(filters);93 Assert.That(result.Count, Is.EqualTo(71));94 }9596 [Test]97 public void List_HierarchyWithExclusionOfAll_ListOfMembers()98 {99 var connStr = ConnectionStringReader.GetAdomd();100 var excludedMembers = new List<string>() { "All" };101 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, null);102 var filters = new List<CaptionFilter>(){ 103 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),104 new CaptionFilter("Date", DiscoveryTarget.Dimensions),105 new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies),106 };107108 var result = cmd.List(filters);109 Assert.That(result.Count, Is.EqualTo(12));110 }111112 [Test]113 public void List_HierarchyWithExclusionOfPatternEndingByBer_ListOfMembers()114 {115 var connStr = ConnectionStringReader.GetAdomd();116 var excludedMembers = new List<string>() { "All" };117 var excludedPatterns = new List<PatternValue>() { new PatternValue() {Pattern=Pattern.EndWith, Text="ber" }};118 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns);119 var filters = new List<CaptionFilter>(){ 120 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),121 new CaptionFilter("Date", DiscoveryTarget.Dimensions),122 new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies),123 };124125 var result = cmd.List(filters);126 Assert.That(result.Count, Is.EqualTo(8));127 }128129 [Test]130 public void List_HierarchyWithExclusionOfPatternStartingByJu_ListOfMembers()131 {132 var connStr = ConnectionStringReader.GetAdomd();133 var excludedMembers = new List<string>() { "All" };134 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.StartWith, Text = "Ju" } };135 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns);136 var filters = new List<CaptionFilter>(){ 137 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),138 new CaptionFilter("Date", DiscoveryTarget.Dimensions),139 new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies),140 };141142 var result = cmd.List(filters);143 Assert.That(result.Count, Is.EqualTo(10));144 }145146 [Test]147 public void List_HierarchyWithExclusionOfPatternContainEm_ListOfMembers()148 {149 var connStr = ConnectionStringReader.GetAdomd();150 var excludedMembers = new List<string>() { "All" };151 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "em" } };152 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns);153 var filters = new List<CaptionFilter>(){ 154 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),155 new CaptionFilter("Date", DiscoveryTarget.Dimensions),156 new CaptionFilter("Month Of Year", DiscoveryTarget.Hierarchies),157 };158159 var result = cmd.List(filters);160 //SeptEMber, NovEMber, DecEMber161 Assert.That(result.Count, Is.EqualTo(9));162 }163164 [Test]165 public void List_LevelWithExclusionOfPatternContainEm_ListOfMembers()166 {167 var connStr = ConnectionStringReader.GetAdomd();168 var excludedMembers = new List<string>() { "All" };169 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "em" } };170 var cmd = new MembersCommand(connStr, "Members", null, excludedMembers, excludedPatterns);171 var filters = new List<CaptionFilter>(){ 172 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),173 new CaptionFilter("Date", DiscoveryTarget.Dimensions),174 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),175 new CaptionFilter("Month", DiscoveryTarget.Levels),176 };177178 var result = cmd.List(filters);179 //6years and exlude SeptEMber, NovEMber, DecEMber (+All)180 Assert.That(result.Count, Is.EqualTo(6*9));181 }182183 [Test]184 public void List_HierarchyWithMemberChildren_ListOfMembers()185 {186 var connStr = ConnectionStringReader.GetAdomd();187 var member = "Q3 CY 2006";188 var cmd = new MembersCommand(connStr, "Children", member, null, null);189 var filters = new List<CaptionFilter>(){ 190 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),191 new CaptionFilter("Date", DiscoveryTarget.Dimensions),192 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),193 };194195 var result = cmd.List(filters);196 //REturns the 3 months of the Q3197 Assert.That(result.Count, Is.EqualTo(3));198 }199200 [Test]201 public void List_HierarchyWithMemberChildrenAndExclusion_ListOfMembers()202 {203 var connStr = ConnectionStringReader.GetAdomd();204 var member = "Q3 CY 2006";205 var excludedMembers = new List<string>() { "All" };206 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "em" } };207 var cmd = new MembersCommand(connStr, "Children", member, excludedMembers, excludedPatterns);208 var filters = new List<CaptionFilter>(){ 209 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),210 new CaptionFilter("Date", DiscoveryTarget.Dimensions),211 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),212 };213214 var result = cmd.List(filters);215 //REturns the 3 months of the Q3 and remove SeptEMber216 Assert.That(result.Count, Is.EqualTo(2));217 }218219 [Test]220 public void List_LevelWithMemberChildren_ListOfMembers()221 {222 var connStr = ConnectionStringReader.GetAdomd();223 var member = "January 2005";224 var cmd = new MembersCommand(connStr, "Children", member, null, null);225 var filters = new List<CaptionFilter>(){ 226 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),227 new CaptionFilter("Date", DiscoveryTarget.Dimensions),228 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),229 new CaptionFilter("Month", DiscoveryTarget.Levels)230 };231232 var result = cmd.List(filters);233 //Returns the 31 days of the month234 Assert.That(result.Count, Is.EqualTo(31));235 }236237 [Test]238 public void List_LevelsWithMemberChildrenAndExclusion_ListOfMembers()239 {240 var connStr = ConnectionStringReader.GetAdomd();241 var member = "January 2005";242 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.Contain, Text = "3" } };243 var cmd = new MembersCommand(connStr, "Children", member, null, excludedPatterns);244 var filters = new List<CaptionFilter>(){ 245 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),246 new CaptionFilter("Date", DiscoveryTarget.Dimensions),247 new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),248 new CaptionFilter("Month", DiscoveryTarget.Levels)249 };250251 var result = cmd.List(filters);252 //Returns the 31 days of the month minus 3, 13, 23, 30, 31253 Assert.That(result.Count, Is.EqualTo(31-5));254 }255256 [Test]257 public void List_Set_ListOfMembers()258 {259 var connStr = ConnectionStringReader.GetAdomd();260 var cmd = new MembersCommand(connStr, string.Empty, string.Empty, null, null);261 var filters = new List<CaptionFilter>(){ 262 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),263 new CaptionFilter("Top 50 Customers", DiscoveryTarget.Sets)264 };265266 var result = cmd.List(filters);267 Assert.That(result.Count, Is.EqualTo(50));268 }269270 [Test]271 [Ignore("Filtering not defined for sets")]272 public void List_SetWithExclusion_ListOfMembers()273 {274 var connStr = ConnectionStringReader.GetAdomd();275 var excludedPatterns = new List<PatternValue>() { new PatternValue() { Pattern = Pattern.StartWith, Text = "A" } };276 var cmd = new MembersCommand(connStr, string.Empty, string.Empty, null, excludedPatterns);277 var filters = new List<CaptionFilter>(){ 278 new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),279 new CaptionFilter("Top 50 Customers", DiscoveryTarget.Sets)280 };281282 var result = cmd.List(filters);283 Assert.That(result.Count, Is.EqualTo(50));284 }285 }286} ...

Full Screen

Full Screen

MembersCommand.cs

Source:MembersCommand.cs Github

copy

Full Screen

...9using NBi.Extensibility;1011namespace NBi.Core.Analysis.Member12{13 public class MembersCommand14 {15 public event ProgressStatusHandler ProgressStatusChanged;1617 public string ConnectionString { get; private set; }18 public string Function { get; private set; }19 public string MemberCaption { get; private set; }20 public IEnumerable<string> ExcludedMembers { get; private set; }21 public IEnumerable<PatternValue> ExcludedPatterns { get; private set; }2223 public MembersCommand(string connectionString, string function, string memberCaption)24 : this(connectionString,function,memberCaption,null, null)25 {}2627 public MembersCommand(string connectionString, string function, string memberCaption, IEnumerable<string> excludedMembers, IEnumerable<PatternValue> excludedPatterns)28 {29 ConnectionString = connectionString;30 Function = function;31 MemberCaption = memberCaption;32 ExcludedMembers = excludedMembers;33 ExcludedPatterns = excludedPatterns;34 }3536 protected void Inform(string text)37 {38 ProgressStatusChanged?.Invoke(this, new ProgressStatusEventArgs(text));39 }4041 protected IDbCommand CreateCommand() ...

Full Screen

Full Screen

MembersAdomdEngine.cs

Source:MembersAdomdEngine.cs Github

copy

Full Screen

...7 public class MembersAdomdEngine8 {9 public virtual MemberResult GetMembers(MembersDiscoveryRequest command)10 {11 var cmd = new MembersCommand(command.ConnectionString, command.Function, command.MemberCaption, command.ExcludedMembers, command.ExcludedPatterns);12 return cmd.List(command.GetAllFilters());13 }14 }15} ...

Full Screen

Full Screen

MembersCommand

Using AI Code Generation

copy

Full Screen

1MembersCommand membersCommand = new MembersCommand();2membersCommand.Members = new List<string>() { "Member1", "Member2" };3membersCommand.Members.Add("Member3");4membersCommand.Members.Add("Member4");5membersCommand.Members.Add("Member5");6membersCommand.Members.Add("Member6");7membersCommand.Members.Add("Member7");8membersCommand.Members.Add("Member8");9membersCommand.Members.Add("Member9");10membersCommand.Members.Add("Member10");11membersCommand.Members.Add("Member11");12membersCommand.Members.Add("Member12");13membersCommand.Members.Add("Member13");14membersCommand.Members.Add("Member14");15membersCommand.Members.Add("Member15");16membersCommand.Members.Add("Member16");17membersCommand.Members.Add("Member17");18membersCommand.Members.Add("Member18");19membersCommand.Members.Add("Member19");20membersCommand.Members.Add("Member20");21membersCommand.Members.Add("Member21");22membersCommand.Members.Add("Member22");23membersCommand.Members.Add("Member23");24membersCommand.Members.Add("Member24");25membersCommand.Members.Add("Member25");26membersCommand.Members.Add("Member26");27membersCommand.Members.Add("Member27");28membersCommand.Members.Add("Member28");29membersCommand.Members.Add("Member29");30membersCommand.Members.Add("Member30");31membersCommand.Members.Add("Member31");32membersCommand.Members.Add("Member32");33membersCommand.Members.Add("Member33");34membersCommand.Members.Add("Member34");35membersCommand.Members.Add("Member35");36membersCommand.Members.Add("Member36");37membersCommand.Members.Add("Member37");38membersCommand.Members.Add("Member38");39membersCommand.Members.Add("Member39");40membersCommand.Members.Add("Member40");41membersCommand.Members.Add("Member41");42membersCommand.Members.Add("Member42");43membersCommand.Members.Add("Member43");44membersCommand.Members.Add("Member44");45membersCommand.Members.Add("Member45");46membersCommand.Members.Add("Member46");47membersCommand.Members.Add("Member47");48membersCommand.Members.Add("Member48");49membersCommand.Members.Add("Member49");50membersCommand.Members.Add("Member50");51membersCommand.Members.Add("Member51");52membersCommand.Members.Add("Member52");53membersCommand.Members.Add("Member53");54membersCommand.Members.Add("Member54");55membersCommand.Members.Add("Member55");56membersCommand.Members.Add("Member56");57membersCommand.Members.Add("Member57");58membersCommand.Members.Add("Member58");59membersCommand.Members.Add("Member59");60membersCommand.Members.Add("Member60");61membersCommand.Members.Add("Member61

Full Screen

Full Screen

MembersCommand

Using AI Code Generation

copy

Full Screen

1var membersCommand = new MembersCommand();2membersCommand.ConnectionString = connectionString;3membersCommand.Catalog = catalog;4membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";5var members = membersCommand.Execute();6var membersCommand = new MembersCommand();7membersCommand.ConnectionString = connectionString;8membersCommand.Catalog = catalog;9membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";10var members = membersCommand.Execute();11var membersCommand = new MembersCommand();12membersCommand.ConnectionString = connectionString;13membersCommand.Catalog = catalog;14membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";15var members = membersCommand.Execute();16var membersCommand = new MembersCommand();17membersCommand.ConnectionString = connectionString;18membersCommand.Catalog = catalog;19membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";20var members = membersCommand.Execute();21var membersCommand = new MembersCommand();22membersCommand.ConnectionString = connectionString;23membersCommand.Catalog = catalog;24membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";25var members = membersCommand.Execute();26var membersCommand = new MembersCommand();27membersCommand.ConnectionString = connectionString;28membersCommand.Catalog = catalog;29membersCommand.Query = "SELECT [Measures].[Unit Sales] ON COLUMNS, [Product].[Product Name].MEMBERS ON ROWS FROM [Adventure Works]";30var members = membersCommand.Execute();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful