Transposing from columns to rows
2 posters
Page 1 of 1
Transposing from columns to rows
I have data extracts from transaction system containing multiple measures (columns) all being of the same type of indicator, for which I would like to transform into multiple rows in my fact table.
E.g. Extract contains (for each row):
date
location
nbr_visitors_can_bc
nbr_visitors_can_on
nbr_visitors_can_qc ... (one for each of the 10 Canadian provinces)
nbr_visitors_us_ma
nbr_visitors_us_wi
nbr_visitors_us_ok ... (one for each of the 50 US states)
I'd like my FACT_VISITATION table to have 60 rows, i.e. one row for each state/province.
I have an ETL tool that would allow me to do 60 passes to load all the rows in my fact table but is there a trick to transpose, i.e. doing that all in one phase. I use Pervasive as ETL tool.
Thanks
E.g. Extract contains (for each row):
date
location
nbr_visitors_can_bc
nbr_visitors_can_on
nbr_visitors_can_qc ... (one for each of the 10 Canadian provinces)
nbr_visitors_us_ma
nbr_visitors_us_wi
nbr_visitors_us_ok ... (one for each of the 50 US states)
I'd like my FACT_VISITATION table to have 60 rows, i.e. one row for each state/province.
I have an ETL tool that would allow me to do 60 passes to load all the rows in my fact table but is there a trick to transpose, i.e. doing that all in one phase. I use Pervasive as ETL tool.
Thanks
nxlefrancois- Posts : 4
Join date : 2009-09-09
Re: Transposing from columns to rows
I am not familiar with Pervasive, but most ETL tools have some means of normalizing data. If you are using Oracle 11g, it has an UNPIVOT clause in SELECT that would do it as well... other database may offer this functionality as well.
RE: Transposing from columns to rows
Thanks, I will have to see if Pervasive can actually do that.
nxlefrancois- Posts : 4
Join date : 2009-09-09
Similar topics
» Converting Columns into Rows.
» Columns to Rows Issue in Dimension
» Time bound variables YTD ,QTD as columns or rows.
» Expiring rows in a SCD
» Model Design best practice - add columns or pivot data for multiple rows ?
» Columns to Rows Issue in Dimension
» Time bound variables YTD ,QTD as columns or rows.
» Expiring rows in a SCD
» Model Design best practice - add columns or pivot data for multiple rows ?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum