Page 1 of 1

What does DB command do if several fields are blank?

Posted: Tue Aug 14, 2012 3:04 pm
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' );

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

Posted: Tue Aug 14, 2012 3:13 pm
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.

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

Posted: Tue Aug 14, 2012 3:26 pm
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 , .....);

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

Posted: Tue Aug 14, 2012 3:33 pm
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?

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

Posted: Tue Aug 14, 2012 3:37 pm
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.

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

Posted: Tue Aug 14, 2012 4:33 pm
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

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

Posted: Tue Aug 14, 2012 4:40 pm
by ioscat
Thaks for complete answer, Steve. Great!

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

Posted: Fri Aug 17, 2012 11:12 am
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