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


Calculated Measure LFL Grand Total


Calculated Measure LFL Grand Total

Author
Message
jamesdanuk
jamesdanuk
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 114
Hi


I have a cube that has Products, Store,Date,Sales Type.


I have two calculated measure


Mature Sales This Year

Sales Last Year


The Mature Sales Measure uses Parallel Period,


CREATE


MEMBER CURRENTCUBE.[Measures].[Mature Net Sales This Year]


AS CASE WHEN (

[Measures].[Mature Net Sales Value],

PARALLELPERIOD ([01 - Date].[Calendar].[Financial Year], 0, [01 - Date].[Calendar].CurrentMember)) =0 THEN NULL ELSE

(

[Measures].[Mature Net Sales Value],

PARALLELPERIOD ([01 - Date].[Calendar].[Financial Year], 0, [01 - Date].[Calendar].CurrentMember))

I have a measure that shows Sales Last Year


CREATE


MEMBER CURRENTCUBE.[Measures].[Net Sales Last Year]


AS


iif


([Measures].[Mature Net Sales This Year] >0,


--case when [Measures].[Mature Net Sales This Year] >0 then


sum


(EXISTING

[Measures].[Net Sales Value],

PARALLELPERIOD ([01 - Date].[Calendar].[Financial Year], 1, [01 - Date].[Calendar].CurrentMember)

),

null ),


FORMAT_STRING


= "#,##.00",


NON_EMPTY_BEHAVIOR


= { [Measures].[Mature Net Sales Value] },


VISIBLE


= 1 , DISPLAY_FOLDER = 'LFL Measures' , ASSOCIATED_MEASURE_GROUP = '01- Sales' ;





END


,


FORMAT_STRING


= "#,#.00",


NON_EMPTY_BEHAVIOR


= { [Measures].[Mature Net Sales Value] },


VISIBLE


= 1 , DISPLAY_FOLDER = 'LFL Measures' , ASSOCIATED_MEASURE_GROUP = '01- Sales' ;


The issue is the displaying of Grand Total if I filter the dimensions by and attribute (Select Few Products etc) the grand total displays correct, the moment I use select all attribute from any dimension the grand Total displays the wrong value.

The Grand Total is not filtering out the shops that did not have mature sales this year.


FYI - The business logic is if there are mature sales this year for the selected period, show last years sales.


Many Thanks


Dan
PB_BI
PB_BI
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1964 Visits: 2517
Have a look at using VisualTotals as this will show a grand total of non-filtered members only.




I'm on LinkedIn
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