SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating a Cell Calculation


Creating a Cell Calculation

Author
Message
rbransfield
rbransfield
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 42
Hi Everyone,

I hope someone out there has experience with this. I am trying to use a cell calculation in my cube that formats a value based on the account it is using (Percent or Currency). The following cell calculation I wrote as a script in my calculation. However when I reprocess the cube the value just disappears. Am I missing something? Thank you for your help.

Bobby

CREATE CELL CALCULATION [Property].[TestFormat]
FOR '([Income_Statement].[Account List].&[464], [Budget Variance])'
AS [Measures].CurrentMember
,FORMAT_STRING = "#,##0.00 %;-#,##0.00 %";
Mackers
Mackers
SSC Veteran
SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)SSC Veteran (299 reputation)

Group: General Forum Members
Points: 299 Visits: 499
Hi Bobby,

What version of SSAS are you using? Haven't used cell calcs in yearrrrrrrrrsssssssssss

If you are using 2005+ then you could try

SCOPE([Income_Statement].[Account List].&[464]);   --not sure I included everything you wanted

FORMAT_STRING(This) = "#,##0.00 %;-#,##0.00 %";

END SCOPE;



Mack
rbransfield
rbransfield
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 42
Thanks for your replay Mack.

I am using 2012. I added the code that you posted and it doesn't appear to work. I admit I'm new to this... However when I plug the scope statement into my calculation script it throws an error on the "SCOPE". The error is that stupid syntax for ';' is incorrect. Is there something that needs to go in front of this in order to apply it in this scenario? From everything I've read the scope statement starts there...so I am confused as to what I could be missing. This is what I am seeing.
Attachments
CodeView.jpg (6 views, 123.00 KB)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search