Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Need Help On Aggregation i have input like
input:
PO Number | PO Line Item | Amt |
---|---|---|
100 | 1 | 50 |
100 | 1 | 45 |
100 | 1 | 70 |
100 | 2 | 90 |
100 | 3 | 20 |
output:
PO Number | PO Line Item | Amt | output |
---|---|---|---|
100 | 1 | 50 | 47.5 |
100 | 1 | 45 | 47.5 |
100 | 1 | 70 | 180 |
100 | 2 | 90 | 180 |
100 | 3 | 20 | 180 |
The Logic is If PO Number and PO Line Item Both are like previous records We have to do the AVG and
if PO Number and PO line item different like previous record we have to do the SUM Of those records as showcase in the Output table
Here am attaching the sample data please help me
In attach file have 2 sheets Sheet1 is input and Sheet2 Is Output
I don't understand your logic.
On line 1 I see PO Number 100 and PO Line Item 1. There are no previous rows, i.e. there is no line 0. So what applies here to this line, sum or avg?
On line 3 I see PO Number 100 and PO Line Item 1. Those are the same values as on the previous row. So according to your logic avg should be applied. But your result uses sum instead.
This doesn't make sense.
Hi ,
Thanks For rly,
If see above output table 3 PO Number and PO Line Item Has been repeated
here the logic is first 2 rows need to be in Average and 3 row which is starting as sequential need to be in sum
please help me in this
Thanks
See attached example.