sql - SUM total by Year -
i working on hr project receives export our sap system weekly. delivers weekly totals input general ledger specific account.
company code g/l fiscal year local currency amount in lc 0020 4544000 2012 usd 575.00 0020 4544000 2012 usd 252.70 0020 4544000 2012 usd 89.75 0020 4544000 2012 usd 44.00 null null 2012 total null 86,422.58 0020 4544000 2013 usd 2,000.00 0020 4544000 2013 usd -2,000.00 0020 4544000 2013 usd 35.00 0020 4544000 2013 usd 35.00 null null 2013 total null 110,979.23 null 0004544000 total null 197,401.81 grand total null null null 197,401.81
(i removed several rows save space)
what need sum of year.
fiscal year amount in lc 2012 86,422.58 2013 110,979.23
and needs continue on 2016 or beyond.
the file importing .xlsx exported sap system. have had consultant refine export first couple unusable.
i have ssis package imports data, runs through aggregation before exporting staging table. however, sumed totals causing duplication in staging table. if there way run derived column remove data help.
the aggregation data looks this.
fiscal year amount in lc null 394803.62 <- needs removed 2012 86422.58 <- correct 2013 110979.23 <- correct 2012 total 86422.58 <- duplication, needs removed 2013 total 110979.23 <- duplication, needs removed
thank can provide.
i assume since you're running aggregation in ssis there's sql task being executed.
you should edit where
criteria of sql task exclude records:
where [fiscal year] not null , [fiscal year] not '%total%'
if not using sql task, add conditional split between aggregation , ole db destination.
Comments
Post a Comment