Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Suppressing data Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Topic: Suppressing data
    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




Edited by Nav522 - 01 Feb 2017 at 1:52pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Feb 2017 at 3:37am
is this only about suppressing or are you going to need to do calculations on the 'results'
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 03 Feb 2017 at 5:13am
This is going to be only suppressing no calculations needed in the Footer.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
)

Edited by DBlank - 03 Feb 2017 at 6:03am
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Feb 2017 at 8:27am
add in a condition in each part that the table.amt <> 0
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet 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?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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.


Edited by DBlank - 06 Feb 2017 at 2:47am
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 03 Feb 2017 at 10:40am
Thank you. Let me try that.
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet 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?
IP IP Logged
Page  of 2 Next >>
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.