Print Page | Close Window

Suppressing data

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22219
Printed Date: 05 May 2024 at 5:29am


Topic: Suppressing data
Posted By: Nav522
Subject: Suppressing data
Date Posted: 01 Feb 2017 at 8:27am
I have a scenario where I have to suppress the entire row based on a condition. I'm not sure how to write that but posting it here for some assistance.

Here is the data and want to bring only those records if the reversal happened on the same Date. For Example

Agent ABC2 has a -$10 reversal for the Date 6/20

Policy   AgentID Reversalcode DATE Amt

123       ABC2                   5/20   10
123       ABC2                   5/20   10   
123       ABC2          R        6/20   -10
123       ABC2                    6/20   10
123       ABC2                    7/20    30
123       ABC2                     8/20    40
456        XYZ3          R        1/20   -50
456        XYZ3                   1/20     50

I was using {next} function on the Date to suppress but its suppressing every time there is a date change regardless of the policy.

have to suppress only with in a given policy.

Output:

123       ABC2          R        6/20   -10
123       ABC2                     6/20   10
456        XYZ3          R        1/20   -50
456        XYZ3                     1/20   50





Replies:
Posted By: DBlank
Date Posted: 03 Feb 2017 at 3:37am
is this only about suppressing or are you going to need to do calculations on the 'results'


Posted By: Nav522
Date Posted: 03 Feb 2017 at 5:13am
This is going to be only suppressing no calculations needed in the Footer.


Posted By: DBlank
Date Posted: 03 Feb 2017 at 6:03am
maybe this...
NOT
(
table.policy = next(table.policy) and
table.AgentID = next(table.AgentID) and
table.Reversalcode = next(table.Reversalcode) and
(table.Amt + next(table.Amt)=0
)
or
(
table.policy = Previous(table.policy) and
table.AgentID = Previous(table.AgentID) and
table.Reversalcode = Previous(table.Reversalcode) and
(table.Amt + Previous(table.Amt)=0
)


Posted By: Nav522
Date Posted: 03 Feb 2017 at 8:24am
That didn't work. Looks like I have some of the rows with Zero Amounts and this is what it returned

Real Data:
123       ABC2                   5/20   10
123       ABC2                   5/20   10    
123       ABC2          R        6/20   -10
123       ABC2                    6/20   10
123       ABC2                    6/20   0
123       ABC2           R        6/20   0
123       ABC2                    7/20    30
123       ABC2                     8/20    40


Output returned after using the Suppression formula
123       ABC2           R        6/20   0
123       ABC2                     6/20   0

I should only see these records

123       ABC2          R        6/20   -10
123       ABC2                    6/20   10


Posted By: DBlank
Date Posted: 03 Feb 2017 at 8:27am
add in a condition in each part that the table.amt <> 0


Posted By: Nav522
Date Posted: 03 Feb 2017 at 8:38am
Added the table.amt <> 0 condition in each part and now the detail section is completely suppressed no data.

I noticed I haveent used Date in either of the parts. Should I use that too?


Posted By: DBlank
Date Posted: 03 Feb 2017 at 9:45am
based on your description I would say you need the date included as it is a key requirement.
Basically all you are doing is comparing the current row value to the next row value and trying to create the full scope of conditions in that comparison for when you should show or hide the entire row.
I suggested using both Next () and Previous() comparisons because you always want to show the 'pair' of rows.


Posted By: Nav522
Date Posted: 03 Feb 2017 at 10:40am
Thank you. Let me try that.


Posted By: Nav522
Date Posted: 10 Feb 2017 at 4:37am
It works after I used the table.amt <> 0.
Except the First and Last rows of the report are just not meeting the condition.

Is there a way I can use not on firstrecord or something like that?


Posted By: DBlank
Date Posted: 10 Feb 2017 at 7:42am
First I would try and set the formula to 'use default values for nulls'. The first and last records are comparing to NULLS are stopping the fomrula from finishing evaluating


Posted By: Nav522
Date Posted: 10 Feb 2017 at 8:09am
That worked perfect. Thanks you da man.



Print Page | Close Window