Reputation: 988
using crystal report 7
Single report (no sub report added, group by id)
ID Value total
001 100 2000
001 200 3000
-------------
total 300 5000 (a)
002 300 1000
002 200 2000
-------------
total 500 3000 (b)
003 300 1000
003 200 2000
-------------
total 500 3000 (c)
......
I have n number of subtotal like a, b, c ....., each subtotal i want to make subtotal2/ subtotal1 like b/a, c/a .....
Expected Ouput
ID Value total subtotal
001 100 2000
002 200 3000
-------------------
total 300 5000 0
002 300 1000
002 200 2000
-------------------
total 500 3000 0.6
003 300 1000
003 200 1000
-------------------
total 500 2000 0.4
......
How to do it in crystal report.
Can any one give me a idea or formula help
Upvotes: 1
Views: 4464
Reputation: 6037
Forgive me, as I have not worked with a version of Crystal that old, but hopefully at least one of these solutions will be suitable:
shared numbervar total_a := sum({table.total});
shared numbervar total_a; sum({table.total}) / total_a;
OR similar to the above solution:
global numbervar total_a := 0;
global numbervar total_a; if total_a = 0 then total_a := sum({table.total}); sum({table.total}) / total_a;
Upvotes: 2