Calculation Package <ul><li>Obejective:  </li></ul><ul><li>Will Calculate the total order by product. </li></ul><ul><li>Wi...
Target Outcome: ( SQL code) <ul><li>Use Adventureworks </li></ul><ul><li>Select  </li></ul><ul><li>p.ProductID, sum(p.Quan...
Target Outcome : (SQL code) Snapshot:
Contol Flow
Note: Some task are created for testing purposes.
 
Data Flow Calculate values
<ul><li>Note : Some transformation are added for testing purposes . </li></ul>
Source: OLEDB Destination: dbo.Adventureworks <ul><li>SELECT  ProductID,Quantity,ActualCost </li></ul><ul><li>FROM  Produc...
Derived Column: Calculate LineItemTotalCost <ul><li>Quantity * ActualCost </li></ul>
Aggregate : Sum Quantity and LineItemTotalCost <ul><li>[ProductID] = Group By(ProductID) </li></ul><ul><li>[QuantitySum] =...
Derived Column 2: Calculate Average Cost <ul><li>[AvgCostByID] = TotalCostByID / QuantitySum </li></ul>
Sort Transformation: Sort by ProductID <ul><li>Order By Product ID Desc </li></ul>
Destination: Flat File Destination: Load Data <ul><li>C:DOCUME~1KARLO~1.CAMLOCALS~1Temp </li></ul>
Configuration Package This will support the file system task for locating the specific flat file in the hard drive.
Destination
 
Upcoming SlideShare
Loading in...5
×

Calculation Package

166

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
166
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Calculation Package

  1. 1. Calculation Package <ul><li>Obejective: </li></ul><ul><li>Will Calculate the total order by product. </li></ul><ul><li>Wil calculate the total average by product. </li></ul><ul><li>Will Calculate The total cost of the product. </li></ul><ul><li>From Database source to Flat file destination </li></ul>
  2. 2. Target Outcome: ( SQL code) <ul><li>Use Adventureworks </li></ul><ul><li>Select </li></ul><ul><li>p.ProductID, sum(p.Quantity) as [Quantity Sum], </li></ul><ul><li>Sum(p.Quantity*ActualCost) as [Total Cost], </li></ul><ul><li>avg([t].[Total Cost]/[t].[Quantity Sum]) as [average] </li></ul><ul><li>from </li></ul><ul><li>Production.TransactionHistoryArchive p </li></ul><ul><li>,(Select ProductID, sum(Quantity) as [Quantity Sum], </li></ul><ul><li>Sum(Quantity*ActualCost) as [Total Cost] </li></ul><ul><li>from Production.TransactionHistoryArchive </li></ul><ul><li>group by ProductID) t </li></ul><ul><li>where p.ProductID = t.ProductID </li></ul><ul><li>group by p.ProductID </li></ul><ul><li>order by p.ProductID </li></ul>
  3. 3. Target Outcome : (SQL code) Snapshot:
  4. 4. Contol Flow
  5. 5. Note: Some task are created for testing purposes.
  6. 7. Data Flow Calculate values
  7. 8. <ul><li>Note : Some transformation are added for testing purposes . </li></ul>
  8. 9. Source: OLEDB Destination: dbo.Adventureworks <ul><li>SELECT ProductID,Quantity,ActualCost </li></ul><ul><li>FROM Production.TransactionHistoryArchive </li></ul>
  9. 10. Derived Column: Calculate LineItemTotalCost <ul><li>Quantity * ActualCost </li></ul>
  10. 11. Aggregate : Sum Quantity and LineItemTotalCost <ul><li>[ProductID] = Group By(ProductID) </li></ul><ul><li>[QuantitySum] = Sum (Quantity) </li></ul><ul><li>[TotalCostById] = Sum(LineItemTotalCost) </li></ul>
  11. 12. Derived Column 2: Calculate Average Cost <ul><li>[AvgCostByID] = TotalCostByID / QuantitySum </li></ul>
  12. 13. Sort Transformation: Sort by ProductID <ul><li>Order By Product ID Desc </li></ul>
  13. 14. Destination: Flat File Destination: Load Data <ul><li>C:DOCUME~1KARLO~1.CAMLOCALS~1Temp </li></ul>
  14. 15. Configuration Package This will support the file system task for locating the specific flat file in the hard drive.
  15. 16. Destination
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×