cancel
Showing results for 
Search instead for 
Did you mean: 

First value aggregation weird result

Former Member
0 Kudos

Dear SAP Experts,

I have an issue regarding first value aggregation.

I have bex data like this:

Sales order#      Material#      Billing#      Bill Amount        Net SO Amount

S1                        M1           #                        0                 6000 ->this row not yet billed yet

S1                        M2           #                        0                 6000 ->this row not yet billed yet

S1                        M3           B3                     800              6000

S1                        M3           B4                     400              6000

Grand Total                                                  1200             18000-> should be 6000

I have the aggregation to First value for Net So amt. and reference characteristic as Billing #.

Why I got 18,000 in total for net so amount instead of 6000.


If the first and second row not exist, I got the correct result :

Sales order#      Material#      Billing#      Bill Amount        Net SO Amount

S1                        M3           B3                     800              6000

S1                        M3           B4                     400              6000

Grand Total                                                  1200             6000           

Why I got 18,000 instead 6000 when I have null value for Billing# column? 

Is there any solution for my issue?

Thank you very much.

Regards              

Accepted Solutions (1)

Accepted Solutions (1)

anshu_lilhori
Active Contributor
0 Kudos

Yen,the reason behind this is that the reference characteristic that you used is billing # and this has to have unique values so you have 3 unique values #,B3 and B4

So while aggregating on first value it considered the first 2 records into 1 and it became 12000 and then the other 2 records are unique so it took one more 6000 from there.Finally your total becomes 18000.

If you have similar kind of data then i think nested exception aggregation based on material and billing # should work in your case.

Nested exception aggregation basically concatenate the fields.If we apply based on material and billing # then all the records become unique.For eg:M1#,M2#...

Hope this gives you some insight on exception aggregation weird behavior.

Regards,

AL

Former Member
0 Kudos

Hi AL,

Thank you for the answer.

I got clear why this happening now.

I want to give you the sample but I don't know how to send it to you.

So I made some example data.

So for the solution for this is  that I have to made 2 formula.

First I create formula for aggregation first value with reference billing#.

And then I create new formula with first formula (with ref billing#) inside it then made it as exception aggregation first value again with reference material#.

I that what I should do?

Kindly help me.

Regards

anshu_lilhori
Active Contributor
0 Kudos

Yes this is exactly what i meant.You can try it and hopefully it should give desired result.

Regards,

AL

Former Member
0 Kudos

Hi AL,

thank you...I will try it right away.

By the way...if after that I want to have summary overall total group by sales order then I have to create another formula again with last formula (aggregation first value with ref material#) inside it but using aggregation summation with reference sales order#.

Is that correct?

Kindly help

anshu_lilhori
Active Contributor
0 Kudos

Yes exactly..Now you got the complete concept of nested exception aggregation.

Regards,

AL

Former Member
0 Kudos

Thanks a lot, AL.

I will try it now.

I will return to you again.

Former Member
0 Kudos

hi AL,

It's workss...thank you very much.

Thank youuuu very much,AL

Answers (0)