Here's one of the below example to do:
You should use [SELECT:] function for this.
The formula would look something like this:
<value line item>/<value line item>[SELECT:<list_A>.<Total Item>]
<value line item> - is your line item to calculate the ratio
<list_A> - list name
<Total Item> - Total item name of <list_A>
Thanks for the answer. I was also finding if there is some other way than using SELECT.
If for some reason you do not want to set the top-level summary, you can create another module and sum over all items.
Then use the LOOKUP function to get the sum back.