dbTalk Databases Forums  

Question on Calc Members

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


Discuss Question on Calc Members in the microsoft.public.sqlserver.olap forum.



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

Default Question on Calc Members - 05-10-2006 , 07:51 PM






Hi,
I have the following fact table

id qty qtyleft qtydam delivyesno
1 5 2 1 1
1 2 0 0 0

I need to create a calc memeber to read

netsale = ( (when delivyesno = 1 then qty - qtyleft - qtydam) - (when
delivyesno = 0 then qty) )

At the moment I have qty, qtyleft, qtydam as measures. Please advice.

Reply With Quote
  #2  
Old   
ZULFIQAR SYED
 
Posts: n/a

Default RE: Question on Calc Members - 05-10-2006 , 08:32 PM






I created the following expression in SS2k5 olap cube and it worked for me.

(case when delivyesno = 1 then qty-qtyleft-qtydam else 0 end) - (case when
delivyesno = 0 then qty else 0 end)

HTH..
--
http://zulfiqar.typepad.com
BSEE, MCP


"Chris" wrote:

Quote:
Hi,
I have the following fact table

id qty qtyleft qtydam delivyesno
1 5 2 1 1
1 2 0 0 0

I need to create a calc memeber to read

netsale = ( (when delivyesno = 1 then qty - qtyleft - qtydam) - (when
delivyesno = 0 then qty) )

At the moment I have qty, qtyleft, qtydam as measures. Please advice.

Reply With Quote
  #3  
Old   
Chris
 
Posts: n/a

Default RE: Question on Calc Members - 05-10-2006 , 09:24 PM



The problem is that this data is in the FACT TABLE and when I try to create a
measure I don't see the FACT Table listed to select the column like

CASE [Measure]...

Any other ideas? I am using SQL 2000. Even If I want to create a separate
CUBE the problem I have is that the data I want to use in the CASE or IIF
exists in the FACT Table.

Thanks

"ZULFIQAR SYED" wrote:

Quote:
I created the following expression in SS2k5 olap cube and it worked for me.

(case when delivyesno = 1 then qty-qtyleft-qtydam else 0 end) - (case when
delivyesno = 0 then qty else 0 end)

HTH..
--
http://zulfiqar.typepad.com
BSEE, MCP


"Chris" wrote:

Hi,
I have the following fact table

id qty qtyleft qtydam delivyesno
1 5 2 1 1
1 2 0 0 0

I need to create a calc memeber to read

netsale = ( (when delivyesno = 1 then qty - qtyleft - qtydam) - (when
delivyesno = 0 then qty) )

At the moment I have qty, qtyleft, qtydam as measures. Please advice.

Reply With Quote
  #4  
Old   
BK
 
Posts: n/a

Default Re: Question on Calc Members - 05-11-2006 , 09:37 AM



If you make delivyesno a slicer in you cube then the following
calculation should work...

iif([delivyesno].currentmember is [delivyesno].[YourLevelName].&[1],
qty - qtyleft - qtydam,0)


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.