Need help. How to do sum ifs on master data based on another table.
Master data Hierarchy is Group account (4digit) > Each group account can have several Account number (8 digit) > each account number can have several Segment (5 digit) > and each segmnet can have many Profit center (10 digit). I have used Group function to group the data at profit center level.. The lowest level in the hierarchy. And arrived at the amount per PC (profit center) level.
My criteria table has many conditions on what line items to consider for GRP account total.. (Table 2)
Say for Example for account :
- For 1000 (grp account name) take sum of all transaction..irrespective of other criteria.
- for 1100 grp account.. take sum of only one account number.. say 11002300
- For 1200 group account, take sum of 2 segment..S1562 S1761 (other crtieria dont mater)
- For 1300 Group account, take sum of 13005000 account, only one segment S1562, but say 10 different PC PC100000023, PC100000024...PC100000032
- For account 1400.. take sum of all transactions but ignore one segment S2013
How can I apply different criteria for each group account to table 1 (master data). And get the total at GRP account level or Account number.
So above table will look something like this.
Grp account---Account number---Segment---Profit center
1000---ALL---ALL-ALL
1100--11002300 only--ALL--ALL
1200--ALL--S1562 and S1761--ALL
1300--13005000 only--S1562 only-- and 10 PCs as provided abvoe
1400--All-- Take all Segment but exclude S2013--All