Bug in the .NET API when retrieving elements for TM1Cell?

Post Reply
bagovino
Posts: 26
Joined: Fri Oct 09, 2009 5:54 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2007

Bug in the .NET API when retrieving elements for TM1Cell?

Post by bagovino »

I have to familiarize myself with the TM1 .NET API for work and either I have come across a bug in the API or am doing something completely wrong.

When trying to read a cell value from a cube the API help file says you just have to pass an array of strings that make up the dimensionality of the cell you want to retrieve the value for. This works fine when every dimension in the cube is a flat dimension. However, whenever I use a dimension that has consolidated elements the API can only see those elements that are root elements.

Here is my code, which is pretty much lifted directly from their help files. Note that the _tm1server object is correctly instantiated. The user I'm using is an admin so it should be able to see everything as well:

public void TM1CubeReadWriteCellNoView()
{
string[] elements = { "Actuals", "June" };
TM1Cell cell;

try
{

cell =_tm1server.Cubes["Test2"].Cells[elements];

Console.WriteLine("Current value for cube cell: " + cell.Value);
Console.WriteLine("Adding 3 to the current cell value");
cell.Value = ((double)cell.Value + 3.0);
cell.Refresh();
Console.WriteLine("New value for cube cell: " + cell.Value);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}

This will work fine if "Actuals" and "June" are root elements. But let's say for instance I add "Quarter 2" as a parent of "June" in the second dimension I will get the following error: Element [June] not found in dimension [Year]. If I then switch the second element of the string array from "June" to "Quarter 2" it will work fine.

I believe what is happening is that when the API goes to verify the elements you pass it are valid elements for the Dimension it is using the "Elements" or "RootElements" property (both return only the root elements of dimension) instead of AllElements. Does anyone have any experience with this? Am I missing something completely obvious or is my hunch right?

This is on Windows XP and TM1 9.4.1 MR1
cwilliamson
Posts: 5
Joined: Thu Oct 15, 2009 2:45 pm
OLAP Product: TM1
Version: 9.4
Excel Version: Excel 2003

Re: Bug in the .NET API when retrieving elements for TM1Cell?

Post by cwilliamson »

I've been trying to use the .NET API and had the same issue.

We contacted IBM/Cognos about it a year ago and were basically told "yeah, we know it doesn't work" with no suggestion that they were planning on fixing it.

I haven't contacted them since then, have you tried asking the IBM support about it?
bagovino
Posts: 26
Joined: Fri Oct 09, 2009 5:54 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2007

Re: Bug in the .NET API when retrieving elements for TM1Cell?

Post by bagovino »

I'm planning on submitting a SR to them, but I'm waiting on our partner account administrator to add me to the list of people who can submit one. The fact that you let them know over a year ago and they still didn't fix it is worrisome though.

Thanks for the reply!
bagovino
Posts: 26
Joined: Fri Oct 09, 2009 5:54 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2007

Re: Bug in the .NET API when retrieving elements for TM1Cell?

Post by bagovino »

I just received this reply to my SR, so it looks like it will (finally) be fixed in the next FP.
Sorry for the delay, I was out of the office since right after that last email. I did indeed find this as an open defect targeted for 9.4.1 FP3 due out in 1Q2010. The defect number is COGCQ00165698. There does not appear to be a workaround unfortunately. I would suggest checking back with support in late December to check on the status of this defect to make sure FP3 is still on target.
cwilliamson
Posts: 5
Joined: Thu Oct 15, 2009 2:45 pm
OLAP Product: TM1
Version: 9.4
Excel Version: Excel 2003

Re: Bug in the .NET API when retrieving elements for TM1Cell?

Post by cwilliamson »

Thanks for the update!
CoN73mP7
Posts: 37
Joined: Wed May 18, 2011 7:48 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2003
Location: Stuttgart, Germany
Contact:

Re: Bug in the .NET API when retrieving elements for TM1Cell

Post by CoN73mP7 »

I just found this post while using google search because I have the same Problem. Did they ever fix this bug? Sorry for posting in such an old post ;-)
bagovino
Posts: 26
Joined: Fri Oct 09, 2009 5:54 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2007

Re: Bug in the .NET API when retrieving elements for TM1Cell

Post by bagovino »

I'm not sure, to be honest. I switched over to using the regular TM1 API shortly after this because of all the shortcomings with the .NET API and never went back to check.

I believe when I posted this I was using a version of 9.4.x so if you're on a version of 9.5.x and still having this issue I'm going to guess that they never bothered to fix the problem.
Post Reply