Solved

Search for the first "good" value

Posted on 2003-12-11
3
322 Views
Last Modified: 2012-06-27
I have a DB field that contains NULL values.

I want to display the first NON-NULL value in my group header.

I've tried to use the 'while' clause and NextIsNull without success.

Is there a way to do it ?

(CR9, over ODBC connection to Sybase)

0
Comment
Question by:dekt
  • 2
3 Comments
 
LVL 3

Expert Comment

by:AnnetteHarper
ID: 9921011
So, you have a report that is grouped and within each group there are records that are NULL for a certain field, but it is not the group by field? And, I assume that you are sorting inside the group so that all of the NULL values come first?

You have to remember that database queries are set-oriented and not sequentially processed (for the most part). If you wanted to display the maximum or minimum non-null value within the group, that would be easy, you would just create a summary field.

Crystal formulas are computed with the current row's data. The exception being running total formulas. If you wanted to display the first non-null value in the group footer, that would be relatively easy, too. You would use a running total field to store the first non-null value and then display it in the footer. But you can't display it in the header.

I don't think exactly what you need can be done. If you were using Oracle 9i, I could give you a query that would return the value you desire using the new analytic functions, but I don't believe Sybase has equivalent functions.
0
 

Author Comment

by:dekt
ID: 9955316
If I understand correctly, there is no way in Crystal to have a code inside a "regular" formula (not running total) to run in scope larger than the current row ?

"running total" is not an option since this field must be in the "header" of the group.
0
 
LVL 3

Accepted Solution

by:
AnnetteHarper earned 125 total points
ID: 9956917
That's correct, except for running totals, and aggregation functions like SUM which have an optional scope-type parameter, formulas in Crystal refer to the fields in the current record. Running totals, either built-in or manually created, can imitate row-by-row procedural logic, but their value is determined by their position in the report, and you can't display the desired result before the rows it uses are displayed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now