What does DB command do if several fields are blank?

Post Reply
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

What does DB command do if several fields are blank?

Post by ioscat »

Good evening to all!

What does DB command do if several fields are blank?

DB ( 'CubeName', 'element of dim 1', 'element of dim 2', 'element of dim 2', , , , 'element of dim 6' );
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: What does DB command do if several fields are blank?

Post by qml »

Depends where you use the DB() formula - in a rule, in a feeder statement or in TI. In the first two cases it fails silently, whereas TI would throw an error.
Kamil Arendt
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

Re: What does DB command do if several fields are blank?

Post by ioscat »

Thank you, qml.

is there any difference between two strings:

Code: Select all

if ( condition statement , DB ( ...... el1 , el2,  ..... ) , continue );
and

Code: Select all

DB ( .... , if ( condition statement , el1 , '' ) , el2 , .....);
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: What does DB command do if several fields are blank?

Post by declanr »

ioscat wrote:Thank you, qml.

is there any difference between two strings:

Code: Select all

if ( condition statement , DB ( ...... el1 , el2,  ..... ) , continue );
and

Code: Select all

DB ( .... , if ( condition statement , el1 , '' ) , el2 , .....);
ioscat,

I don't mean to insult with this one but the questions you are asking are quite straight forward to find the answers to... simply by putting them into a rule within a test cube... is this something you have considered?
Declan Rodger
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

Re: What does DB command do if several fields are blank?

Post by ioscat »

as for test there is nothing difference, but sometimes gurus can give an advice about how to do it right and gow not to it wrong.
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: What does DB command do if several fields are blank?

Post by Steve Rowe »

In a rule sheet they are different.

The first statement with continue for the false condtion would allow you to write another rule against the area on the left of the rule.

The second statement the false condition evaluates to a DB that is incomplete which will always return 0.

In a feeder the first one won't compile and in a TI neither will compile since the function is different.
HTH
Technical Director
www.infocat.co.uk
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

Re: What does DB command do if several fields are blank?

Post by ioscat »

Thaks for complete answer, Steve. Great!
User avatar
jameswebber
Community Contributor
Posts: 188
Joined: Sun Nov 21, 2010 8:00 pm
OLAP Product: Cognos Express 10
Version: CE 10.1.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: What does DB command do if several fields are blank?

Post by jameswebber »

Anyone else find it really annoying that nothing happens in the first case?..really hard to unpick issues in rules sometimes because of this
Post Reply