data types in columns

Jul 29, 2014 at 9:49 PM

NBi seems to try to be smart and tells me that a second column in a query needs to be numeric, even though it's not. How can I override this or am I doing something wrong?

The error-text is:

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

Best regards,
Jul 29, 2014 at 10:37 PM
By default, NBi assumes that the first columns play the role of a key and the last column has a role of value. The difference between a key and a value is important for NBi to help you to identify if a row is missing/unexpected (key) or simply incorrect (value).

For keys the type 'Text' is the default and for the values the type 'Numeric' is the default.

You an override this easily applying the different information available here
Jul 30, 2014 at 7:49 AM
Thank you for your quick answer!

I get the Intention. May it be, that for certain queries my current approach is not the best one? I have a two different datasets returning the same report parameters which I would like to compare.

ReportName ParameterName Prompt Value
4 Quadranten Modell nach Cluster paraVonMonatAlt Von Monat Vergleich [Datum].[Nach Monaten].[keine Auswahl]
4 Quadranten Modell nach Cluster paraXmin Kosten Soll-Ist Minimum -30
4 Quadranten Modell nach Cluster paraXmax Kosten Soll-Ist Maximum 30
4 Quadranten Modell nach Cluster paraYmin PI Minimum 80
4 Quadranten Modell nach Cluster paraYmax PI Maximum 120
4 Quadranten Modell nach Cluster paraGoodXmin 0
4 Quadranten Modell nach Cluster paraGoodXmax 20
4 Quadranten Modell nach Cluster paraGoodYmin 100

I override the key/value-logic as follows:
      <column  index="0" role="value" type="text"/>
        <column  index="1" role="value" type="text"/>
        <column  index="2" role="value" type="text"/>
        <column  index="3" role="value" type="text"/>
When I define the columns another exception occurs:
NBi.NUnit.Runtime.TestSuite.Check default parameters of report '4 Quadranten Modell nach Cluster':
NBi.NUnit.Runtime.CustomStackTraceErrorException : The expected data set has some duplicated keys. Check your keys definition or the result set defined in your assertion.

I get that I did not define a key. What would you do instead? :)

Thanks a lot,
Jul 30, 2014 at 1:08 PM
If i understand correctly, the first and second columns sould be defined as the keys (text) and the two last as values. The two values should also be defined as text because the first row returns a text and not a numeric.

If you configure your test like this NBi will tell you correctly when your query returns an unexpected or missing parameter and will also be able to tell you correctly when the prompt or value are not correct.

Indeed, nbi doesn't support result-sets without keys.
Marked as answer by Seddryck on 7/30/2014 at 3:03 PM
Jul 30, 2014 at 1:18 PM
This makes sense - and it works! Merci! :)