Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If then Formula help Post Reply Post New Topic
Author Message
JNor
Newbie
Newbie


Joined: 16 Jul 2009
Online Status: Offline
Posts: 1
Quote JNor Replybullet Topic: If then Formula help
    Posted: 16 Jul 2009 at 1:05pm
Good afternoon.

I hope I can explain my issue clearly.

Let me just give you an example first because I can't seem to write this in words properly.

NAME-ID-transaction
Apples-1-01
Pears-1-02
Pears-1-03
Apples-2-04
Apples-2-05
Apples-2-06
Apples-3-07
Apples-3-08
Pears-3-09

For ID = 1, a user enters Apples as the NAME and the Transaction number 01 is created.
On the second transaction, they realize it should be pears instead of apples, so they change it.
The third transaction for ID = 1 doesn't change anything from the second

For ID = 2, there is no error so all of the fields stay the same, the transaction number just move incrementally.

For ID = 3, the user doesn't realize they meant Pears until the third transaction.

My issue is this. When I group by NAME, all 3 IDs show up in the report under Apples:

{Group Apples} by transaction
01
04
05
06
07
08

{Group Pears} by transaction
02
03
09

For me, the most important NAME is the name that the last transaction is pointing to. So really I'd like it to look like this:

{Group Apples} by transaction
04
05
06

{Group Pears} by transaction
01
02
03
07
08
09

Or, at worst, I'd like the transaction to not show up at all in the incorrect NAME group at all like this:

{Group Apples} by transaction
04
05
06

{Group Pears} by transaction
02
03
09

{Group error'd}
01
07
08

I'm not sure how important this is or not but these transactions aren't always clean, meaning the transaction noDs for each

It has been a very long time since I've created any sort of formula outside of the most basic if-then formula so this has really been giving me all sorts of trouble for the last couple days.

Any help would be greatly appreciated. Thanks in advance.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jul 2009 at 6:58pm
The only crystal solution that I am seeing here is to use a sub report.
You will have to group on Name.
Create a shared variable=Name field.
Create a subreport and Place it in the Group Header B or the group footer.
Suppress Details.
IN the sub report run all the rows again. You will need to creat another variable that indicates the last NAME per ID. THen conditionally suppress records based on NAME <> shared variable OR NAME <> sub report variable.
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.