Pct af totalen

Et eksempel på hvordan man kan beregne pct. af totalsalg og pct af salget på niveauet over det aktuelle.

WITH

MEMBER [Measures].[Pct of total] AS ‘SUM( {[Product].CurrentMember}, [Measures].[Unit Sales]) /SUM( {[Product].DefaultMember}, [Measures].[Unit Sales])’, FORMAT_STRING=’#0.00%’

MEMBER [Measures].[Pct of parent total] AS ‘IIF( [Product].Parent <> NULL, SUM( {[Product].CurrentMember}, [Measures].[Unit Sales]) /SUM( {[Product].Parent.Children}, [Measures].[Unit Sales]), 1)’, FORMAT_STRING=’#0.00%’

SELECT

{ [Measures].[Unit Sales], [Measures].[Pct of Total], [Measures].[Pct of parent total] } ON COLUMNS,

NON EMPTY Order( DESCENDANTS( [Product]  ),[Measures].[Pct of total], DESC ) ON ROWS

FROM

[Sales]

Et eksempel på totalten af en delmængde:

WITH
SET [Categories] AS {[Product].[Product Categories].[Category].&[4], [Product].[Product Categories].[Category].&[1]}
MEMBER [Measures].[Contribution] AS ([Product].[Product Categories].CurrentMember, [Measures].[Sales Amount]) / SUM([Categories], [Measures].[Sales Amount]), FORMAT_STRING=”#,##0.00%”
SELECT
{ [Measures].[Sales Amount], [Measures].[Contribution] } ON COLUMNS
,{[Categories] } ON ROWS
FROM [Adventure Works]

 

Den svenske kok på slap line

fi yuo cna raed tihs, yuo hvae a sgtrane mnid too
Cna yuo raed tihs? Olny 55 plepoe out of 100 can.
i cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno’t mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt!