Your SlideShare is downloading. ×
Calculation Package
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Calculation Package

160
views

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
160
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×