View Full Version : How do I read the data from the Result?
bancika
03-19-2010, 11:30 AM
I figured out how to read axis data but still not sure about the actual values. It looks like result.getCell(int[]) is the function I need but couldn't find any doc that explains how to specify the coordinates. Any info is appreciated.
Thanks,
Bane
bancika
03-22-2010, 08:31 AM
bump. Anyone? Please :(
The Alchemist
03-22-2010, 08:35 AM
Something like that:
Query query = connection.parseQuery(<MDX QUERY>);
Result result = null;
result = connection.execute(query);
result.print(new PrintWriter(System.out, true));
bancika
03-22-2010, 09:18 AM
Something like that:
Thanks, but I need to get individual values in the intersection of groups so I can show them in my GUI. In this example I know how to read both axis' using axis.getPosition() and looping over the members. The problem is that I don't know how to read the value circled in red below. It looks like getData(int[]) is the right method but I don't know the meaning of coordinates. It's obvious that I need the intersection of Q1 and ([Store Type]-[All Store Types]-Unit Sales), but I don't know how to get the int value of those two members.
http://i24.photobucket.com/albums/c22/bancika/mdx2.png
Hope it makes sense.
Thanks in advance,
Bane
The Alchemist
03-22-2010, 10:26 AM
well, im not sure about this, because im a beguiner in this matter, but i think you need to know in advance how many result cell's your query will return.
So, if you need to access the red circle cell, the coordinate will be (0,0).
Sorry for can't help you more.
benny_chow
03-23-2010, 01:12 AM
You need to pass in an array containing the position index within each axis.
Each axis has an array of positions where a position is a tuple of members.
For your example, you circled the first position on each axis which is (0,0)
Column Axis: ([Store Types.[All Store Types], [Measures].[Unit Sales])
Row Axis: [Time].[Q1]
bancika
03-23-2010, 08:38 AM
thanks, appreciate it!