Showing posts with label grand. Show all posts
Showing posts with label grand. Show all posts

Tuesday, March 27, 2012

Calculated member for Grand Total...

As part of a cube I would like to have access to the Grand Total for my measure "Events".

Is there a simple way to access the grand total regardless of the Dimensions either as a calculated measure or directly?

for example if the dimensionsion were MonthNumber and EventType and the values for the intersect of these dimensions are

12, a = 5

11,a = 6

12,b = 3

11,b = 2

I'd like to end up with something like :

MonthNumber 12 11

EventType

Events total Events total

a 5 16 6 16

b 3 16 2 16

Where "Events" is the Events value and "total" is combined value of all events in the cube.

Thanks

You would do this by getting the Events measure at the "All Eventtype" level. Your MDX would look something like the following:

WITH
MEMBER Measures.total as '(Measures][Events],[Eventtype].[All Eventtype]'
SELECT
{[Time].[Month].[11],[Time].[Month].[12]}
* {Measures.[Events], Measures.total} ON COLUMNS,
{[Eventyype].members} ON ROWS
FROM <Cube>

Regards
Darren Gosbell [MCSD]
http://geekswithblogs.net/darrengosbell

|||

Thanks for the repy, but I'm kinda looking for access to the grand total functionality, if such a thing exists.

Also this doesn't seem to woirk as a calculated member.

Calculated member for Grand Total...

As part of a cube I would like to have access to the Grand Total for my measure "Events".

Is there a simple way to access the grand total regardless of the Dimensions either as a calculated measure or directly?

for example if the dimensionsion were MonthNumber and EventType and the values for the intersect of these dimensions are

12, a = 5

11,a = 6

12,b = 3

11,b = 2

I'd like to end up with something like :

MonthNumber 12 11

EventType

Events total Events total

a 5 16 6 16

b 3 16 2 16

Where "Events" is the Events value and "total" is combined value of all events in the cube.

Thanks

You would do this by getting the Events measure at the "All Eventtype" level. Your MDX would look something like the following:

WITH
MEMBER Measures.total as '(Measures][Events],[Eventtype].[All Eventtype]'
SELECT
{[Time].[Month].[11],[Time].[Month].[12]}
* {Measures.[Events], Measures.total} ON COLUMNS,
{[Eventyype].members} ON ROWS
FROM <Cube>

Regards
Darren Gosbell [MCSD]
http://geekswithblogs.net/darrengosbell

|||

Thanks for the repy, but I'm kinda looking for access to the grand total functionality, if such a thing exists.

Also this doesn't seem to woirk as a calculated member.

Calculated Member - #VALUE! in the Grand Total

Hi all

This is a simple question on MDX.

We have created a calcualted member that basically compares an existing measure to an attribute, and displays a certain value based on what's in the attribute (simple case statement)

The calcualtion works fine against the proper dimension, but for Grand Total displays #VALUE!. What do I have to do to make the grand total actually display a grand total of this calculated member in the cube?

Thanks in advance

Moe

Hi Moe,

Can you give an idea of what the MDX for the calculated member looks like?

|||

Hi Deepak

Here's the code for the calculated member. Please let me know if you need anything else.

CREATE MEMBER CURRENTCUBE.[MEASURES].[calc - Spare Cost]

AS case when [Repairs].[Repair Status].&[Done] then [Measures].[ARC Buy Price]

when [Repairs].[Repair Status].&[Not Done] then 0

else -1 end,

FORMAT_STRING = "#",

NON_EMPTY_BEHAVIOR = { [ARC Buy Price] },

VISIBLE = 1;

|||

If the intent is to return the value of [Measures].[ARC Buy Price] associated with the [Repairs].[Repair Status].&[Done] member, maybe something simpler like this will work:

CREATE MEMBER CURRENTCUBE.[MEASURES].[calc - Spare Cost]

AS iif([Repairs].[Repair Status].CurrentMember is [Repairs].[Repair Status].&[Not Done],

0, ([Repairs].[Repair Status].&[Done], [Measures].[ARC Buy Price])),

FORMAT_STRING = "#",

NON_EMPTY_BEHAVIOR = { [ARC Buy Price] },

VISIBLE = 1;

|||

Hi Deepak

Thanks for the reply.

The code sample you sent me gives me a value in the Grand Total now, but I am confused as to what this Grand Total actually is .

To simplify my problem, I created the following example based on Northwind:

CALCULATE;

CREATE MEMBER CURRENTCUBE.[MEASURES].[Calculated Member]

AS iif(

[Orders].[Customer ID].CurrentMember = [CHOPS], 5, 1),

FORMAT_STRING = "#",

NON_EMPTY_BEHAVIOR = { [Orders Count] },

VISIBLE = 1 ;

The above code gives me a Grand Total of 1! is this correct?

Thanks again

Moe

|||

Hi Moe,

I'm not clear how to run your sample code - could you provide an Adventure Works equivalent? Also, what should your results layout look like - and how many members of [Repairs].[Repair Status] are there (I assumed that there are just 2)?

Monday, March 19, 2012

Calc % in crystal detail againt running total

Quick question.
I have a grand total being calculated in a formula, for each detail line I am trying to get a percentage of that number against a value in the detail. The problem is that the grand total is running and only calculates against the current running total not against the grand total when the report finishes. Any way around this?Hi!

1) Insert the Formula Field from Report Design Page

2) Named as Percentage and write the code to the formula field coding area

{table.numberfiled}/100

3) And Drag and Drop the Formula Filed on Details Section Where do u want place.