How to Compare SUM of Subtotal, and Total

HI,
I have a problem.
I am collecting “pieces” info to create an automation that works on ServiceNow and another website.
They are at a “crucial” point. Basically the end of a long job.
I have to compare the total prices, which, on SITE 1, and as a total,
but on ServiceNow it is unpacked.
I am not using the snow API. for now. However it is working.
Now my block is between the comparison Total of Site1, with,
all sub total of ServiceNow.

With an image maybe is better… .
image

On Site1, I have the total divided only for PO_Line.
(10k, 25K)
On Service Now the total is divided by Object ID too.
I have to make sure that the sum of the Approved Value, having same PO Line, corresponds to the Total of Site 1.
If it matches, I have to take action,
otherwise, of the others.

Thanks…