Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Most Recent Value from Non Recurring Field 1

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR13 with an Oracle db as my data source. I've got a quota attainment report and the SQL is currently only returning quota attainment % if there are sales in the period. The client wants an attainment % each month and if there are no sales in the current month, the % attainment should equal the most recent attainment %. If I have sales in January and February but not in March, how do I write a formula so that March displays the attainment % from February?? For this example, there would be a % for period 1 and period 2, but no record for period 3. Basically I need to use the period value if it exists, and the most recent period value if the period value does not exist.
 
can you try something like this? I haven't tried it though
if isnull({field}) then previous({field}) else {field}
 
There isn't a simple way to do this because CR only reports on data that exists. It can't automatically generate data that isn't there. There are some workarounds in an old newsletter I posted here:


If we are talking about one or two missing periods you might find method 6 is best, especially since you want to use the same values as the period prior.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top