Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Pivoted Value to Simplified Data is SSIS

Author  Topic 

Kalaiselvan
Posting Yak Master

112 Posts

Posted - 2013-08-30 : 09:46:49
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

52326 Posts

Posted - 2013-08-31 : 06:15:42
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
Go to Top of Page
   

- Advertisement -