Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Average Formula Help! Post Reply Post New Topic
Author Message
crystalisfun
Newbie
Newbie
Avatar

Joined: 08 Apr 2013
Location: United States
Online Status: Offline
Posts: 1
Quote crystalisfun Replybullet Topic: Average Formula Help!
    Posted: 09 Apr 2013 at 8:48am
Hey guys...I have a crosstab I have built to give me averages of quarterly data...the only data being pulled in is for the past four quarters. In order to get the YTD numbers (as opposed to average), I had to create a simple formula of Average ({data field}, {property number}) which works fine until I try to make that average various data points that are divided by lets say number of units for example. Here's one of the formulas and it won't do the last calculation.

if {quarterly_income_statement_by_quarter.Principal Payments 1}
-{quarterly_income_statement_by_quarter.Principal Payments 2}
-{quarterly_income_statement_by_quarter.Principal Payments 3} = 0 then 0
else Average ({quarterly_income_statement_by_quarter.Total Operating Expenses},{property_information.Property Number})
- Average({quarterly_income_statement_by_quarter.Principal Payments 1},{property_information.Property Number})
- Average({quarterly_income_statement_by_quarter.Principal Payments 2},{property_information.Property Number})
- Average({quarterly_income_statement_by_quarter.Principal Payments 3},{property_information.Property Number})
+ Average({quarterly_income_statement_by_quarter.Interest - 1st Debt},{property_information.Property Number})
+ Average({quarterly_income_statement_by_quarter.Interest - 2nd Debt},{property_information.Property Number})
+ Average({quarterly_income_statement_by_quarter.Interest - 3rd Debt},{property_information.Property Number})
/ Average ({quarterly_income_statement_by_quarter.Total Income}, {property_information.Property Number})*100

The first part before "if zero then 0" is to avoid the dividing by zero issue...but if you see, I am trying to divide the total formula by "total income" in this case...and trying to turn it into a percentage. This is for breakeven occupancy. I tried adding parenthesis before the average and it keeps giving me an error. How can I get it to give me the end result? Thanks so much!!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.