dbTalk Databases Forums  

Re: Transpose data for cube

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Re: Transpose data for cube in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Transpose data for cube - 11-21-2005 , 09:44 PM






Hi Des,

If both relational SQL Server 2005 and AS 2005 are an option, then maybe
you can create a named query for the fact table in the AS 2005 Data
Source View, which uses the new TSQL PIVOT command to transpose the
data:

http://msdn2.microsoft.com/en-us/library/ms177410.aspx
Quote:
Using PIVOT and UNPIVOT

You can use the PIVOT and UNPIVOT relational operators to manipulate a
table-valued expression into another table. PIVOT rotates a table-valued
expression by turning the unique values from one column in the
expression into multiple columns in the output, and performs
aggregations where necessary on any remaining column values that are
desired in the final output.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #2  
Old   
Des Norton
 
Posts: n/a

Default Re: Transpose data for cube - 11-22-2005 , 12:54 AM






Hi Deepak


Thanks for the response..

Unfortunately I dont have any control over the box, and am bound to using
SQL2000 and AS2000.


Regards
Des Norton



Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Transpose data for cube - 11-22-2005 , 07:25 PM



You can still do Pivots in SQL 2k, it just involves a lot more code than
the PIVOT command.

One such example using dynamic SQL can be found here
http://www.sqlteam.com/item.asp?ItemID=2955, in fact this code is more
flexible than the PIVOT command as it will dynamically work out the
columns, PIVOT in SQL2k5 requires a static list of values.

I'm sure a search on google could turn up many more. I know there are
methods using case statements which require a static column list, but do
not use dynamic sql.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell



In article <ObpATIz7FHA.2676 (AT) TK2MSFTNGP15 (DOT) phx.gbl>,
desREMOVEnortonUPPERCASE (AT) gmail (DOT) com says...
Quote:
Hi Deepak


Thanks for the response..

Unfortunately I dont have any control over the box, and am bound to using
SQL2000 and AS2000.


Regards
Des Norton





Reply With Quote
  #4  
Old   
Des Norton
 
Posts: n/a

Default Re: Transpose data for cube - 11-28-2005 , 03:43 AM



Thanks Darren

Quote:
http://www.sqlteam.com/item.asp?ItemID=2955,
With some mods for specific requirements, workes like a charm.

Regards
Des Norton


"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote

Quote:
You can still do Pivots in SQL 2k, it just involves a lot more code than
the PIVOT command.

One such example using dynamic SQL can be found here
http://www.sqlteam.com/item.asp?ItemID=2955, in fact this code is more
flexible than the PIVOT command as it will dynamically work out the
columns, PIVOT in SQL2k5 requires a static list of values.

I'm sure a search on google could turn up many more. I know there are
methods using case statements which require a static column list, but do
not use dynamic sql.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell



In article <ObpATIz7FHA.2676 (AT) TK2MSFTNGP15 (DOT) phx.gbl>,
desREMOVEnortonUPPERCASE (AT) gmail (DOT) com says...
Hi Deepak


Thanks for the response..

Unfortunately I dont have any control over the box, and am bound to using
SQL2000 and AS2000.


Regards
Des Norton







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.