Solved

Search for the first "good" value

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

21 Experts available now in Live!

Get 1:1 Help Now