CellIsUpdateable

Suggest and discuss enhancements for TM1
Post Reply
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

CellIsUpdateable

Post by Steve Vincent »

This could have been made twice as useful as it is had someone thought about it more...

CellIsUpdateable checks if a cell can be written to, but it FAILS if one of the elements doesn't exist. Rather than failing (and dumping things in to the error log) it should also return zero if the element is missing, then it'd be far more useful. Its not hard to code your own way of reporting which part is causing the issue, and this alteration would make it easier and less CPU intensive to check values if it could handle both errors at once.

As it stands, i'm having to do a DIMIX check on every data point first, then report on any issues whereas the ideal would be to filter out issues using CellIsUpdateable then do the DIMIX check to figure out which ones.
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: CellIsUpdateable

Post by Alan Kirk »

Steve Vincent wrote:This could have been made twice as useful as it is had someone thought about it more...

CellIsUpdateable checks if a cell can be written to, but it FAILS if one of the elements doesn't exist. Rather than failing (and dumping things in to the error log) it should also return zero if the element is missing,
I doez disagree on this one. My belief is that a function return value should always have a specific and unambiguous meaning. Consequently I'd rather that if the element doesn't exist, it returns -1 rather than 0. The test for whether the cell is writeable can still be expressed as

Code: Select all

if (CellIsUpdateable(Blah)=1); 
or alternatively

Code: Select all

if (CellIsUpdateable(Blah)>0) 
so no changes to exisitng code would be needed, but if it returned -1 for a missing element then you'd have the option of using an If/Elseif block and save a little code and a few processing cycles:

Code: Select all

l_Writeable = CellIsUpdateable(Blah);

If ( l_Writeable <0);
    #Insert the element, write a log file, throw a party, whatever
ElseIf ( l_Writeable = 0);
    # Bang user on head with frying pan and tell them to stop trying to write to consolidations or rules elements, or whatever
Else;
    #Write your value and may the gods have mercy on your soul, etc
EndIf;


If you don't care whether it's un-writeable or simply doesn't exist, you could still use "< 1" as the test criterion.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: CellIsUpdateable

Post by Steve Vincent »

Yep, works for me too. Even a 0 1 2 result would work as long as it had been documented what each result meant. Anything other than creating an error message would be of help :)
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Post Reply