WITH 
grp AS (
    SELECT 
        o.account
        ,o.shipgrp
        ,o.part
        ,o.oseas
        ,o.odate 
        ,o.sseas
        ,o.sdate
        -- ,o.calc_status
        ,ROUND(sum(fb_qty * lbs),5) lbs
        ,ROUND(sum(fb_qty),2) qty 
        ,ROUND(sum(fb_val_loc * r_rate),2) sales_usd
        ,ROUND(sum(fb_cst_loc_cur * c_rate),2) cost_curstd_usd
    FROM 
        rlarp.osmf o
    WHERE
        iter IN ('actuals','actuals_plug','copy')
    GROUP BY 
        o.account
        ,o.shipgrp
        ,o.part
        ,o.oseas
        ,o.odate 
        ,o.sseas
        ,o.sdate
        -- ,o.calc_status
)
    SELECT
         account
        ,shipgrp
        ,part
        ,oseas
        ,odate 
        ,sseas
        ,sdate
        -- ,calc_status
        ,lbs
        ,qty 
        ,sales_usd
        ,cost_curstd_usd
        ,sum(lbs) OVER (PARTITION BY shipgrp, oseas) shiplbs
    FROM 
        grp
