dbTalk Databases Forums  

Olap substring

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


Discuss Olap substring in the microsoft.public.sqlserver.olap forum.



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

Default Olap substring - 04-04-2006 , 09:16 AM






select
substring(account, 0 , 6), substring(account, 6, 3), substring(account, 8,
3)
from lc_dw_accounting_csv

How do i do this in OLAP

I have Account number (11111900200) need split into 3 different columns
account_number = 11111
Item = 900
sub_item = 200

Please help me

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Olap substring - 04-04-2006 , 08:48 PM






Assuming that you're using AS 2005, you can create a named Query in the
Data Source View which returns the 3 fields:

select account,
substring(account, 1, 5) as AccountNumber,
substring(account, 6, 3) as Item,
substring(account, 9, 3) as SubItem
from lc_dw_accounting_csv

Then you can define an Account dimension, with account as the key
attribute, and AccountNumber, Item and SubItem as other attributes. Each
attribute can have its own hierarchy.


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

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.