Monday, February 20, 2012

MDX Parameter in Report...

Dear Friends,

I have a doubt, and I need your support...

I have 4 tables that are in one dimension STRUCTURE.

The Structure is:

1. Entidade

2. Carteira

3 Mesa

4. Folder

In my report I have these 4 combobox with data and related...

So the problem is...

I need to show a field in the report based on the selection... For example:

1oWhen

1. Entidade = 'LIS'

2. Carteira = 'ALL'

3 Mesa = 'ALL'

4. Folder = 'ALL'

I want to show in the textbox1.value the CalculatedMember1

2oWhen

1. Entidade = 'LIS'

2. Carteira = 'LIS-CPR'

3 Mesa = 'ALL'

4. Folder = 'ALL'

I want to show in the textbox1.value the CalculatedMember2

3oWhen

1. Entidade = 'LIS'

2. Carteira = 'LIS-CPR'

3 Mesa = 'LIS-CPR-ME1'

4. Folder = 'ALL'

I want to show in the textbox1.value the CalculatedMember3

4oWhen

1. Entidade = 'LIS'

2. Carteira = 'LIS-CPR'

3 Mesa = 'LIS-CPR-ME1'

4. Folder = 'FOLDER1'

I want to show in the textbox1.value the CalculatedMember4

It's Possible?

Someone help me?

Regards!!

I'm assuming that this means that you want the calculation to work differently at the different levels. Why not create a 4th calculation and use scope assignment to return the approriate value at the appropriate level?

I'm assuming that these attributes are in a hierarchy, but you did not mention what the name of that was, so I have just used the text "" as a placeholder.

Code Snippet

CREATE MEMBER currentcube.measures.CalculatedMember5 as (CalculatedMember1)

SCOPE (STRUCTURE.<hierarchy>.Carteira.Members);

(measures.CalculatedMember4) = (measures.CalculatedMember2);

END SCOPE;

SCOPE (STRUCTURE.<hierarchy>.Mesa.Members);

(measures.CalculatedMember4) = (measures.CalculatedMember3);

END SCOPE;

SCOPE (STRUCTURE.<hierarchy>.Folder.Members);

(measures.CalculatedMember4) = (measures.CalculatedMember4);

END SCOPE;

Then in your report you just referece CalculatedMember5

|||

Dear Darren,

I didn't understand your statment...

I need to use CM1 or CM2 or CM3 or CM4 depending on the values selected by the user in the combobox's report.

So I found a solution to get if inside the report, but It would be better If I control it in a CM in spite of textbox report... So I did like this:

Code Snippet

=IIF(Parameters!DimStructureCarteiraID.Value(0)="[DimStructure].[Carteira_ID].[All]"
AND Parameters!DimStructureMesaID.Value(0)="[DimStructure].[Mesa_ID].[All]"
AND Parameters!DimStructureFolderID.Value(0)="[DimStructure].[Folder_ID].[All]"
,Sum(Fields!CM_1.Value, "dSource1")
,IIF(Parameters!DimStructureMesaID.Value(0)="[DimStructure].[Mesa_ID].[All]"
AND Parameters!DimStructureFolderID.Value(0)="[DimStructure].[Folder_ID].[All]"
,Sum(Fields!CM_2.Value, "dSource1")
,IIF(Parameters!DimStructureFolderID.Value(0)="[DimStructure].[Folder_ID].[All]"
,Sum(Fields!CM_3.Value, "dSource1")
,Sum(Fields!CM_4.Value, "dSource1")
)
)
)

But would be better to call for example a CMX in spite of using this formula for each textbox...

I will try to convert this statment to inside my dataset...

Understood?

Regards and thanks!

|||The scope statement will only work inside the MDX script of your cube. You could probably do similar logic to your SSRS expression inside the MDX using a similar IIF() pattern.

No comments:

Post a Comment