Seddryck / NBi

NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.
http://www.nbi.io
Apache License 2.0
106 stars 37 forks source link

MDX Query: is there some significance for the word Global #224

Closed khanaus closed 7 years ago

khanaus commented 7 years ago

Hi, Im trying to run the MDX query as system under test it fails in nBI GUI where as it works fine in my MDX studio (MDX Query Analyser).

The query is

SELECT NON EMPTY { [Measures].[Movement] } ON COLUMNS, NON EMPTY {( [ValueDate].[ValueDate].[ValueDate].ALLMEMBERS , [Reporting].[Reporting].[Global Reporting].[Global].[Global TB].[TB].[ATB].[GLM AU].[FXF].[FUN3000]) } ON ROWS FROM ( SELECT ( {[Centre].[Centre].[3000] } ) ON COLUMNS FROM ( SELECT ( { [ValueDate].[ValueDate].[2016-11-03] } ) ON COLUMNS FROM [PL]))

The Error i get is

NBi.NUnit.Runtime.CustomStackTraceErrorException : The column with an index of 2 is expecting a numeric value but the first row of your result set contains a value 'Global' not recognized as a valid numeric value or a valid interval.

FuegoArtificial commented 7 years ago

Hi Khanaus,

is the second column of your result set completely numeric as the error-message states must be numeric? if you look for a solution with a direct text-to-text comparison among all columns, maybe the following solved issue solves yours? I use it a lot: https://github.com/Seddryck/NBi/issues/76

if you want to define the data type for each column please check the documentation here: http://www.nbi.io/docs/compare-configuration/

Cheers

khanaus commented 7 years ago

Its working now when i use the where clause in my mdx query. I have noticed that when u are using it as abovem hierarchy based columns are returning values like Global|Global R| Global TB|...... instead i was expecting it to only return the leaf node i.e. last value

Seddryck commented 7 years ago

Indeed, when using the level of an hierarchy in a query, all the parent levels are returned and not just this level. This is by design in the ADOMD.net connector and not specific to NBi.