# BI Publisher XML - How to subtract two numbers



## Lori713 (Sep 8, 2003)

Hi,

I've *just* started using Oracle's BI Publisher (XMLP) and I'm trying to write a simple (HAH!) Statement of Net Assets report.

Basic visual structure is this:


```
===================================================
              Curr Year        Prior Year
Assets
 Cash               3               6
 Blah               2               1
 Blah               5               2
Total Assets       10               9

Liabilities
 Accts Pay          2               4
 Blah               1               1
 Blah               1               2
Total Liabilities   4               7

Total Net Assets    6               2    [this would be where Total Assets minus Total Liabilities goes]
===================================================
```
I'm using Word to create my .rtf file (and I have my .xml and .xsd files created). I'm using a query to pull in my data. The data looks great (almost mirrors the report itself), but I am having trouble figuring out how to add and subtract certain lines/rows within the report.

The query results looks like this:

```
Total Val     Subtot Val      Detail Val      Descr           CurrYr              PriorYr
1000           1100              1110         Cash               3                   6
1000           1100              1120         Blah               2                   1
and so on...
2000           2100              2110         Accts Pay          2                   4
and so on...
```
I'm using the Total values and Subtotal values to do my groupings and subtotals on those groupings. (The values are merely char 4 fields to designate classification categories).

Is it possible to do something that allows you to subtract a certain row from another row?

I am stuck in how to go about telling it on a certain row I want to show total assets minus total liabilities. I have googled my brains out and tried all sorts of examples (and obviously incorrectly) but nothing comes right out and says 'here is how to subtract one row from another'. Is my dataset wrong? I thought I had enough parent/child relationships to accomplish the task.

If you need to see the .xml, .xsd, or .rtf files, please let me know. I didn't know how much info to put here without bogging it down too much.

Thanks!

Lori


----------

