Showing posts with label calculate. Show all posts
Showing posts with label calculate. Show all posts

Wednesday, March 28, 2012

Row-level CRC?

Does anyone know if SQL Server 2005 as a built-in way (sp or func) to calculate a row-level CRC?Does anyone know if SQL Server 2005 as a built-in way (sp or func) to calculate a row-level CRC?

Do you mean like BINARY_CHECKSUM?

Check out SQL BOL.

Regards,

hmscott|||Do you mean like BINARY_CHECKSUM?

Check out SQL BOL.

Regards,

hmscott

Yes, that's exactly what I needed.

Thanks a lot.

Wednesday, March 7, 2012

Rounding Calculated Member

I have the following calculated member that is being used to create Offline/Local cubes.

CALCULATE;

CREATE MEMBER CURRENTCUBE.[MEASURES].[Percentage]

AS Case

When IsEmpty( [Measures].[Event Count] )

Then 0

Else ((

[EE Event Template Type Dim].[Event Types].CurrentMember,

[Measures].[Event Count]) /

( [EE Event Template Type Dim].[Event Types].[(All)].[All],

[Measures].[Event Count]

)*100)

End,

FORMAT_STRING = "###.##%",

BACK_COLOR = 12632256 /*Silver*/ ,

FORE_COLOR = 16744576 /*R=128, G=128, B=255*/ ,

VISIBLE = 1 ;

I'm looking for a way to round the result. The FORMAT_STRING functionality does not carry over when I create the local cube so I end up with values like 28.90909097.

Any suggestions would be appreciated.

Tristan

Tristan,

Have you tried the "format" function?

Format(

Case

When IsEmpty( [Measures].[Event Count] )

Then 0

... rest of case statement from original calculation

,"###.##%")

|||That did the trick! Much Thanks!