Skip to Main Content

PLSQL aggegations with addition and Subtraction

User_DT6AQMar 26 2019 — edited Mar 27 2019

Hi All,

I have below input table with members in Parent/Child format with aggregation and data present at Level-0 members.

Can some one help with PL/SQL code to aggregate data to the upper level members based on the aggregation symbol for each row.

Input Table:

   

ParentChildLevelAggregationData
TopACC2+
ACCACC11+
ACC1ACC1_10+400
ACC1ACC1_20+350
ACC1ACC1_30-150
ACCACC21-
ACC2ACC2_10+50
ACC2ACC2_20+150

Output Table:

   

ParentChildLevelAggregationData
TopACC2+400
ACCACC11+600
ACC1ACC1_10+400
ACC1ACC1_20+350
ACC1ACC1_30-150
ACCACC21-200
ACC2ACC2_10+50
ACC2ACC2_20+

150

Thanks,

Taiyab

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Apr 24 2019
Added on Mar 26 2019
3 comments
108 views