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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column data deviding with a column data

Status
Not open for further replies.

zambakh

Technical User
Jun 29, 2009
7
TR
Hi,
I have a column with tha following datas:
4*
7
9*
12
3
I need to devide all numbers by the total of two column data:
4* ---> 4 / (4+9)
7 ---> 7 / (4+9)
9* ---> 9 / (4+9)
12 ---> 12/ (4+9)
3 ---> 3 / (4+9)
How can I formulate this.
Urgent please, immidiate replies will be highly appreciated.
Thanks a lot inadvance
 
I don't think you can, as such. You've not explained what the various figures mean, but whatever they are, you can't add just some of them in advance of showing them.

What you might have to do is a subreport above the figures to find the value or values and pass it back using a Shared Variable.

The use of Crystal's automated totals is outlined at FAQ767-6524.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Let's assume that the two values for the denominator (from fieldA) have the same value in some other fieldB. Then you could create a formula like this:

//{@denom}:
if {table.fieldB} = "xyz" then
{table.fieldA}

Then you could use a formula like this:

{table.fieldA}/sum({@denom})

If you are evaluating the denominator within some group, then change the formula to:

{table.fieldA}/sum({@denom},{table.groupfield})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top