Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Formula for Line Specific Data

Status
Not open for further replies.

brizaybrizoke

Technical User
Jul 21, 2011
25
US
414fb1eab6d4cae6385f7c83e7bfecee1da53df643d29640d3a08168f31415ba6g.jpg


My starting objective was to create a formula to retrieve results for a specific line of data that had no constants.

First, I added a record number down the first column to provide each line a constant.
Then added a formula down the last column where I want my results.

At first I tried the following formula but it returned with 'False' for the entire column.

if ({No}) = 1 then ({Lines}) - ({Picks}) else
if ({No}) = 2 then ({Lines}) - ({Picks})


I also tried a summary formula which returned with a running total of all lines for all batches.

if ({No}) = 1 then (SUM({Lines})) - (SUM({Picks})) else
if ({No}) = 2 then (SUM({Lines})) - (SUM({Picks}))


What kind of formula will equate Lines and Picks for each Batch?

I am using Crystal Reports ver 8.5

I started teaching myself Crystal yesterday so I'm very, very new to this application.

Thanks!
 
Where is the data for {Picks}

If you are getting multiple records for each batch, then group report by batch and move your data into group footer and suppress details. Create a formula

@Picks
{Lines}-{picks}

You can then add a sum summary of this formual to your group footer.

Ian
 
A formula only evaluates per the current record and a recordnumber cannot be equal to 1 AND to 2, which is why the formula is returning false.

You seem to be referencing the formula {@picks} in the {@picks} formula, and a formula cannot reference itself.

I think you would be better off explaining more generally what you are trying to do here.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top