Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Logic with running totals Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Ronny101
Newbie
Newbie


Joined: 12 Oct 2011
Location: Canada
Online Status: Offline
Posts: 18
Quote Ronny101 Replybullet Topic: Logic with running totals
     Posted: 24 Oct 2011 at 5:20am

I have a running total field  in the details section of my sub report and I wrote a logical formula using the running total. I use the logical formula to display the row in the section expert.

My problem is I need to display all rows where logic=1 plus the next row where my logic is =0.  So if I have 10 rows in the section and the logic=1 in 5 rows I need to show the first 6 rows

Thank you  

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 5:35am
if you are using an actual Running Total field (not just calling a custom formula a RT) then you you cannot use this logic with previous() or next() functions.
Instead you would have to alter your RT logic to handle what you want better or try to create a formula that replaces your RT.
IP IP Logged
Ronny101
Newbie
Newbie


Joined: 12 Oct 2011
Location: Canada
Online Status: Offline
Posts: 18
Quote Ronny101 Replybullet Posted: 24 Oct 2011 at 5:50am
But I am using the Running Total Field to count so I have an identfier for each row 1, 2, 3, ...etc
If I don't use the Running Total how else can I add row1+row2+row3...?
Thank You
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 5:55am
can you post raw row samples data (with no RT) and what you need the rows to do.
IP IP Logged
Ronny101
Newbie
Newbie


Joined: 12 Oct 2011
Location: Canada
Online Status: Offline
Posts: 18
Quote Ronny101 Replybullet Posted: 24 Oct 2011 at 5:58am
I don't understand, can you please expain how to do it?
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 6:19am
can you show some rows of what your data looks like and what you need to do with and the reason why (E.g. what is your logic for your 1/0 Runnnf Total creation)


Edited by DBlank - 24 Oct 2011 at 6:19am
IP IP Logged
Ronny101
Newbie
Newbie


Joined: 12 Oct 2011
Location: Canada
Online Status: Offline
Posts: 18
Quote Ronny101 Replybullet Posted: 24 Oct 2011 at 7:00am
Here is an example of my data
 
Bin #  Lot #  Qty on Hand
15       123          12
52       154           8
69       578           5
 
Now let say that I have an order for 15, I want the report to show only the first 2 rows.  What I did is I introdued RT and wrote a formula that if RT <=Order QTY then 1 else 0
My problem is that RT for row 2 is 20 so only row 1 shows and row 2 does not
Thanks again for your help
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 7:06am
so your "order for 15" is a numeric run time parameter?
and are you looking to show row 2 in this sample only because value is being reomved from it to get to the total order amount (e.g in your sample row one is <15)
IP IP Logged
Ronny101
Newbie
Newbie


Joined: 12 Oct 2011
Location: Canada
Online Status: Offline
Posts: 18
Quote Ronny101 Replybullet Posted: 24 Oct 2011 at 7:13am
Yes OTY Ordered is a parameter I have and in this example lets say its 15
I need to show row 1 and row 2 as shipping will take all stock (12) from row 1 and (3) from row 2 to complete the order
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Oct 2011 at 7:22am
your running total should be set as
name=Qty_sum
field to summarize=Qty on hand
type = sum
evaluate=fopr each record
reset=never (assuming you are not grouping in some way)
your suppress formula for the detail rows is like:
{#Qty_sum}>{?parameter}


Edited by DBlank - 24 Oct 2011 at 7:23am
IP IP Logged
Page  of 2 Next >>
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