Solved

Search for the first "good" value

Posted on 2003-12-11
3
325 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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