hollyx
hollyx

Reputation: 99

BusinessObjects Formula Syntax

I am writing this formula with BusinessObjects DeskI but it returns syntax error. This is my formula:

=IF(length(<Dt_Credit>=0) then <Dt_Credit>=(TODATE("01011900","ddMMyyyy") )    
ELSE <DT_Credit>

Upvotes: 0

Views: 804

Answers (1)

Joe
Joe

Reputation: 6827

There a lot wrong with your formula. Let's break it down:

=IF ( length(<Dt_Credit>=0) 
      then <Dt_Credit>= ( 
                           TODATE("01011900","ddMMyyyy") 
                        )    
      ELSE <DT_Credit>

First off, you have no closing parenthesis. Parentheses are not required in an If/Then, so can you just drop the one after If. You also don't need parentheses around the ToDate function. So we have:

=IF length(<Dt_Credit>=0) 
 then <Dt_Credit> = TODATE("01011900","ddMMyyyy") 
 ELSE <DT_Credit>

Next, you're doing an assignment to the <Dt_Credit> object within a formula, which is impossible. So we'll take that out:

=IF length(<Dt_Credit>=0) 
 then TODATE("01011900","ddMMyyyy") 
 ELSE <DT_Credit>

Next, I'm assuming that <Dt_Credit> is actually a Date object and not a Number. If that's true, then then Length() function won't work as it doesn't accept dates as parameters. If you're testing for a blank <Dt_Credit> then you should use IsNull() instead:

=IF IsNull (<Dt_Credit>) 
 then TODATE("01011900","ddMMyyyy") 
 ELSE <DT_Credit>

Finally, I'm assuming that you're using DeskI. If it's WebI, then the syntax is a little different. Replace < > with [ ].

Upvotes: 1

Related Questions