Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum/Aggregation help!

Hi,

I have the following Load code that result in the table shown.

DRP:

LOAD @1:27 as part_key,

    @230:239 as [week 1],

    @254:263 as [week 2],

    @278:287 as [week 3],

    @302:311 as [week 4]

FROM [$(sLastFile)] (fix, codepage is 1252)

WHERE @52:55='B';

Item Number[week 1][week 2][week 3][week 4]
52Z4351703001112                    60
52Z4351720001112                    60
52Z2812408600111260          60
52Z28161011001112                    60
PEFR9254A112121217

What I want to achieve is to aggregate the amount starting with week 1. Would like the following resulting table;

Item Number[week 1][week 2][week 3][week 4]
52Z4351703001112                    172
52Z4351720001112                    172
52Z28124086001112172          232
52Z28161011001112                    172
PEFR9254A112243653

Is there any simple code for this. Given that it's 52 weeks I'd prefer not to use the following code;

DRP:

LOAD @1:27 as part_key,

    @230:239 as [week 1],

    @230:239+@254:263 as [week 2],

    @230:239+@254:263+@278:287 as [week 3],

    @230:239+@254:263+@278:287+@302:311 as [week 4]

FROM [$(sLastFile)] (fix, codepage is 1252)

WHERE @52:55='B';

Thankful for any help!

Best regards,

Jonas

1 Reply
Not applicable
Author

The table shows production demand Part Numbers per week. What I want to accomplish is to sum the Production Demand within the Lead Time of the part.

I.e. if the Lead Time for part number PEFR9254 is 3 weeks I want to

sum([week 1]+[week 2]+[week 3]) = SUM(12+12+12) = 36

The lead time is different for different part numbers.

Jonas