I have an MDX query I am pulling through using Adomd.net where cmd contains the command text.
This, when run directly against a cube returns the following output, just a caption and the count integar, this being a measure:
TrueCount
n
However, how do I access this measure/tuple/number through c# ?
I know how I can get the caption, TrueCount out (see below), but I don't know how to get the blooming number out.
//Execute the query, returning a cellset
CellSet cs = cmd.ExecuteCellSet();
//Output the column captions from the first axis
TupleCollection tuplesOnColumns = cs.Axes[0].Set.Tuples;
foreach (var column in tuplesOnColumns)
if (!column.Members[0].Caption.Contains("All"))
truecount.Add(new TrueCount() { CountTitle = column.Members[0].Caption });
Any ideas or pointers greatly appreciated - apologies for the thick question.
I haven't used these functions to run MDX, but my experience with ADOMD is that the captions of rows and columns are accessed from a different object to the numbers in the middle. So I think you need to look at your
cs
object, and not withincs.Axes
.In ADOMD you just say
myNumber = cs(x, y).FormattedValue
Hopefully that might lead you in the right direction!