SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Pivoted Value to Simplified Data is SSIS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kalaiselvan
Posting Yak Master

India
109 Posts

Posted - 08/30/2013 :  09:46:49  Show Profile  Reply with Quote
Hi,
I have Tried with Converting a CSV file to Pivot Transformation. Got some Results with Repeated Column Values.
Need to simplify this Pivot data to Destination.

Ex:
CSV FILE:
[Country] [Brand] [Period] [Volume] [Value]
India Sun JUN 100 500
India Sun JUL 100 500
India Sun AUG 100 500
India Sun JUN 200 500
India Sun JUL 200 500
India Sun AUG 200 500
India Sun JUN 300 500
India Sun JUL 300 500
India Sun AUG 300 500

Pivoted Data: (Pivoting Volume Column as Columns)
[Country] [Brand] [Period] [100] [200] [300]
India Sun JUN 500 - -
India Sun JUL 500 - -
India Sun AUG 500 - -
India Sun JUN - 500 -
India Sun JUL - 500 -
India Sun AUG - 500 -
India Sun JUN - - 500
India Sun JUL - - 500
India Sun AUG - - 500

Need the Above Required Output as:
[Country] [Brand] [Period] [100] [200] [300]
India Sun JUN 500 500 500
India Sun JUL 500 500 500
India Sun AUG 500 500 500

How Could I transform to this Output using Other Component or its possible Thru in Pivot Transformation itself in SSIS. Please help me to Fix this.


Regards,
Kalai

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 08/31/2013 :  06:15:42  Show Profile  Reply with Quote
you need to apply an aggregate transform after pivot
see sample package here

replace the file path and db/server names in config file and try

https://docs.google.com/file/d/0B4ZDNhljf8tQN1c0ak5ESmwtZ00/edit?usp=sharing

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs

Edited by - visakh16 on 08/31/2013 06:16:12
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000