Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: CR Skipping Over Records With Unrelated Null Value Post Reply Post New Topic
Author Message
DBABaracus
Newbie
Newbie
Avatar

Joined: 23 Feb 2016
Online Status: Offline
Posts: 3
Quote DBABaracus Replybullet Topic: CR Skipping Over Records With Unrelated Null Value
    Posted: 23 May 2018 at 9:52am
I'm trying to build a report that shows credit loads for future semesters for students. The data is arranged something like this:

Record ID|Semester |Grade|Attempted Credits

(id)     |2018 Fall|     |3.0


Some students have manually changed credit loads, so they have grades "VC" (Variable Credit). The formula field I'm summing in the report is just:

If [Semester] = "2018 Fall" Then [Attempted Credits] Else 0

But then in the report, it only sums records where the Grade is not blank. I've tried things to isolate the blank grades and add them in ([Grade]="", IsNull{[Grade]}), but CR still doesn't seem to consider them. I've also checked the MDB file that it's based on to validate that the data is indeed there. It's just striking me as weird, because the [Grade] field isn't a key field, linked field, or referenced in any of the formulas or filters. It feels like if it disregarded records of people because their middle initial is blank.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 May 2018 at 8:08am
Is all of this data stored in one table or are you joining tables?
IP IP Logged
DBABaracus
Newbie
Newbie
Avatar

Joined: 23 Feb 2016
Online Status: Offline
Posts: 3
Quote DBABaracus Replybullet Posted: 24 May 2018 at 8:50am
The credit/grade data is all stored in one data. There are separate linked tables for student info, etc., but that's not involved in this particular calculation.

I just double-checked the database and verified that this table does include all grade records, regardless of whether or not the grade is blank/null, "VC", or a normal letter grade. So there's something in Crystal Report that's causing it to skip over the records with blank grades. Again, the grade field is not linked to any other tables, is not referenced in any formula (or group or selection formula), and is not marked as a key field. It's so weird!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 May 2018 at 9:02am
Look closely at your tables and joins.
Joins are not automatically enforced.
They get enforced when you use any field from both ends (or daisy chained) of the table. Sometimes the first (or only) time you use a field from a table is in a formula and all the sudden your entire data set changes. This is because the join was just enforced and your data set just altered.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 May 2018 at 2:39am
Also in the formula field set the option to use 'default values for null'
IP IP Logged
DBABaracus
Newbie
Newbie
Avatar

Joined: 23 Feb 2016
Online Status: Offline
Posts: 3
Quote DBABaracus Replybullet Posted: 25 May 2018 at 5:23am
Originally posted by DBlank

Also in the formula field set the option to use 'default values for null'


This did it!! I feel like such a dunce. I've spent a week or more trying to figure out every conceivable way of writing it into a formula, not realizing the formula itself was ignoring the values. Ughghgh.

Thanks a ton!!!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.