cancel
Showing results for 
Search instead for 
Did you mean: 

CONDITIONAL FORMULA

Former Member
0 Kudos

Using Crystal XI, I need to create a formula to determine if the last 4 fields of a 30 field string contains 'PR' then the field is blank or 0, otherwise if the last 4 fields do not contain PR then my field would = my formula @AO. It seems easy but this is what I've tried and it isn't working: if "PR"in{IV00101.ITEMNMBR} [27-30] then 0 else{@AO}

Thanks,

Jayne

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If there is no possibility of the field being NULL or being less then 30 characters, use this:


if "PR"in {IV00101.ITEMNMBR}[27 to 30] then 0 else{@AO}
// if the result of {@AO} is a string then in the above statement
// change 0 to "0"

Otherwise, use this:


if not(isnull({IV00101.ITEMNMBR})) and
"PR"in {IV00101.ITEMNMBR}[length({IV00101.ITEMNMBR})-4 to length({IV00101.ITEMNMBR})]]
 then 0 else{@AO}
// if the result of {@AO} is a string then in the above statement
// change 0 to "0"

You might also want to check the case sensitivity of PR.

Edited by: Sanjay Kodidine on Dec 14, 2009 7:12 AM

Answers (0)