Crystal Reports 2008

I am trying to create a report using Crystal Reports 2008.
For my end result, I want the loans grouped by:
1.Lien Position
then by:
a.Fixed Rate
c.Adjustable Rate (<= 1yr)
d.Adjustable Rate(> 1yr)
Then by:
a.> 15yrs
b.<= 15yrs
c.> 5yrs
d.<= 5yrs
Part of the report should look like this:
                                                    # of loans             Amount
First Mortgages
      Fixed Rate
                               >15yrs                  500            50,000,000
                               15 yrs or less      1,000        60,000,000
                                 >5yrs                  10               500,000
                                  5 yrs or less     50              1,000,000
      Adjustable Rate
                              1yr or less            20              2,000,000
                             >1 yr                       100            10,000,000
Other Real Estate (2nd liens)
      Closed End Fixed                      400            10,000,000
TOTAL                                                 2,080      133,500,000

Here is the code that I have for @Adjustable:
if {stored procedure;1.LienPosition}="1"  then
    if isnull({stored procedure;1.BalloonPayDt}) then
        if  {stored procedure;1.LoanPayType}="F"  then
           "Fixed Rate"
        Else IF {@DaystoRateChange}=0  then
        Else If {@DaystoRateChange}<=12 then
           "Adjustable Rate 1 yr or less"
           "Adjustable Rate > 1 yr"
Else If isnull({stored procedure;1.FirstRateChgDt}) then
     "Closed-end Fixed Rate"

@YrsToMaturity code:
iif({@Balloon}= "Other",{stored procedure;1.LoanTerm}/12,
datediff("d",{stored procedure;1.DueDtFirstPay},{storedprocedure;1.BalloonPayDt})/365)

@Balloon code:
iif(isdate(cstr({stored procedure;1.BalloonPayDt})),"Balloon","Other")

@Type code:
if {@Adjustable}= "Fixed Rate" then
   if {@YrsToMaturity}> 15 then
        "> 15 Years"
   Else "15 Years or less"
Else If {@Adjustable}="Balloon/Hybrid" then
        if {stored procedure;1.LienPosition}="participation" or {@YrsToMaturity}>5 then
            "> 5 Years"
    Else "5 Years or less"
Else "";
I am at the @Type formula and the results I am getting are only results for the Balloon/Hybrid section and showing if the loans are > 5 years or if they are 5 years or less. All the other categories have them falling under “Other”. I am inserting groups for Lien position, Adjustable and Type and specify an order within the groups. I am not too familiar with Crystal Reports and any help would be greatly appreciated.  
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you get any Fixed Rate records for @Adjustable?

musalmanERP ConsultantCommented:
can you attach the report
moni81011Author Commented:
I did get fixed rate results with the @adjustable, thank you.  Everything seems to be displaying correctly besides separating the fixed rate section between "> 15 Years" and  "15 Years or less".  They are all still combined into one.  So I was thinking my IF THEN and ELSE may be in the wrong place or it is just wrong somehow.

if {@Adjustable}= "Fixed Rate" then
   if {@YrsToMaturity}> 15 then
        "> 15 Years"
   Else "15 Years or less"
Else If {@Adjustable}="Balloon/Hybrid" then
        if {CallReportRealEstateNoBusiness_sp;1.LienPosition}="participation" or {@YrsToMaturity}>5 then
            "> 5 Years"
    Else "5 Years or less"
Else "";

If you need a screen shot of the report and what it looks like, let me know.
Thank you.
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Are there mortgage for less than 15 years?

moni81011Author Commented:
Yes sir.
Are there reports where the BalloonPayDt is null?

If so you need to test for that in the @Ballon code.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
moni81011Author Commented:
I got it. For some reason it didn't like the formula in the @balloon. I thought because it said if there is a date put "balloon", else "other". Well I changed it to say if it is null "other" else "balloon" and it worked. Thank you for telling me to take a look at that formula!
moni81011Author Commented:
Thank you for all your help mlmcc!!!
The problem is that if CR hits a null field in a formula, it just stops evaluating the formula at that point and the formula produces no value.  To avoid that, you can use the IsNull function to test the field _first_, before you do anything else with that field in that formula.

 Another option is to go to File > "Report Options" and set the "Convert Database NULL Values to Default" option, which will replace nulls in pretty much every formula in the report, except the record selection formula.  More recent versions of CR also have an option in the formula editor for how that specific formula will handle nulls.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.