Question : If then statement appears to not be assigning values to some entries

I have a grouping formula that groups my entries for a bank rec report. Every section is working great except section 7 and I am baffled as to why only that number is failing. The Print Preview confirms that elements which should be group 7 are not being assigned a group even though there is a catch all at the end of the if then statement which should catch any entry not associated by the earlier logic.

Please see Code Snippet for the grouping formula and the Image for the print preview with relevant logic fields exposed for reference.

Hopefully I have just overlooked something simple,

Thank you for your consideration.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
//Find Internal Recs that where not on a bank rec (1 is Beggining Balance)
if (({JDT1.ExtrMatch} <> 0) and (isnull({JDT1.MthDate}))) then '1' else 
// Classify all checks that don't have an MthDate or Dates later than the report (6 is Outstanding Checks)
if (({@Matched} = 0)  and ({JDT1.TransType} = '46') and ({JDT1.SourceLine} = 0)) then '6' else
if (({@MthDate Cast} > {?Reconciliation Date}) and ({JDT1.TransType} = '46') and ({JDT1.SourceLine} = 0)) then '6' else
// Classify all other that don't have an MthDate or Dates later than the report (7 is Outstanding Other)
if (({@Matched} = 0)  and ({JDT1.TransType} <> '46')) then '7' else
if (({@Matched} = 0)  and ({JDT1.TransType} = '46') and ({JDT1.SourceLine} <> 0)) then '7' else
if (({@MthDate Cast} > {?Reconciliation Date}) and ({JDT1.TransType} <> '46')) then '7' else
if (({@MthDate Cast} > {?Reconciliation Date}) and ({JDT1.TransType} = '46') and ({JDT1.SourceLine} <> 0)) then '7' else
// Total everything that was previously reconciled (1 is Beggining Balance)
if ({@MthDate Cast} < {?Reconciliation Date}) then '1' else
// Classify Deposits on this Rec. (2 is Deposits)
if (({@MthDate Cast} = {?Reconciliation Date}) and ({JDT1.TransType} = '25')) then '2' else
// Classify Checks on this Rec. (4 is Cleared Payments)
if (({@MthDate Cast} = {?Reconciliation Date}) and ({JDT1.TransType} = '46')) then '4' else
// Classify JE's on this Rec. (3 is Journal Entries)
if (({@MthDate Cast} = {?Reconciliation Date}) and ({JDT1.TransType} = '30')) then '3' else
// All Others (5 is Cleared Receipts)
'5'
Attachments:
 
Print Preview showing missing Grouping
Print Preview showing missing Grouping
 

Answer : If then statement appears to not be assigning values to some entries

This is probably being caused by one of your fields having a NULL value, If a crystal formual encounters a NULL value in a test than then the formula will fail at that point and return a NULL Result, hence not returning catch all of 5

Try limiting your report to a single record that is failing and check each of the fields being used in this formual nd athe relatde {@MthDat Cast} formula.

HTH
Random Solutions  
 
programming4us programming4us