I have 2 data sources (Request and Actual). Below is a sample of my xml:
<dsQuery Response>
<Request>
<Rows>
<Row>
<TravelDate>2013-10-05T05:00:00Z</TravelDate>
<ID>1</ID>
<Cost>1000</Cost>
</Row>
<Row>
<TravelDate>2013-12-31T05:00:00Z</TravelDate>
<ID>2</ID
<Cost>2500</Cost>
</Row>
<Row>
<TravelDate>2014-01-13T06:00:00Z</TravelDate>
<ID>3</ID>
<Cost>1300</Cost>
</Row>
<Row>
<TravelDate>2014-02-01T06:00:00Z</TravelDate>
<ID>4</ID>
<Cost>2300</Cost>
</Row>
<Row>
<TravelDate>2014-08-01T06:00:00Z</TravelDate>
<ID>5</ID>
<Cost>2000</Cost>
</Row>
</Rows>
</Request>
<Actual>
<Rows>
<Row>
<ID>10</ID>
<FormID>2</FormID>
<CheckDate>2014-01-01T12:00:00Z</CheckDate>
</Row>
<Row>
<ID>11</ID>
<FormID>3</FormID>
<CheckDate>2014-01-31T12:00:00Z</CheckDate>
</Row>
<Row>
<ID>12</ID>
<FormID>4</FormID>
<CheckDate>2014-02-15T12:00:00Z</CheckDate>
</Row>
</Rows>
</Actual>
</dsQuery Response>
I need to sum the Cost column if the year for TravelDate=This year OR if the year of the CheckDate = This Year.
In the scenario above Request ID 2-5 meet the criteria. The total should be 8100. I have tried several ways to get the sum and none are working. Any help is appreciated.