Solved

Search for the first "good" value

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

808 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