Showing posts with label developing. Show all posts
Showing posts with label developing. Show all posts

Monday, March 12, 2012

MDX statement using Parameters as Calendar

Hello People,
I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
using MDX to extract the information from the cube, but now I need to get a
range of data as a parameter, but using the Calendar date picker from
Reporting server, do you know if is it possible ?
Thanks,
ElvisHi Elvis,
This issue was discussed a couple of months back (June CTP time-frame) in
the SQL Server 2005 Beta newsgroup, but unfortunately I can no longer locate
it. Anyway, what I recall is that I had to resort to using the old OLE DB for
OLAP Provider (which worked with MDX in RS 2000), because in that case the
MDX query is dynamically built as an expression; and the data type of date
parameters can then be set to DateTime, which will enable the Calendar date
picker. Of course, in that case, the expression has to transform the returned
date string to an appropriate MDX Date Dimension member name.
"elvispires" wrote:
> Hello People,
> I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
> using MDX to extract the information from the cube, but now I need to get a
> range of data as a parameter, but using the Calendar date picker from
> Reporting server, do you know if is it possible ?
> Thanks,
> Elvis
>
>|||hi,
do you have an example of dynamically built mdx ? Becaus i also have that
problem.
with
member [month_list].[jan-sept] AS 'sum([month_list].[All
month_list].[January]:[Month_list].[All month_list].[September])'
the last [September] is supposed to be tha name of the current month
Thanks!
"Deepak" wrote:
> Hi Elvis,
> This issue was discussed a couple of months back (June CTP time-frame) in
> the SQL Server 2005 Beta newsgroup, but unfortunately I can no longer locate
> it. Anyway, what I recall is that I had to resort to using the old OLE DB for
> OLAP Provider (which worked with MDX in RS 2000), because in that case the
> MDX query is dynamically built as an expression; and the data type of date
> parameters can then be set to DateTime, which will enable the Calendar date
> picker. Of course, in that case, the expression has to transform the returned
> date string to an appropriate MDX Date Dimension member name.
> "elvispires" wrote:
> > Hello People,
> >
> > I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
> > using MDX to extract the information from the cube, but now I need to get a
> > range of data as a parameter, but using the Calendar date picker from
> > Reporting server, do you know if is it possible ?
> >
> > Thanks,
> > Elvis
> >
> >
> >
> >

Friday, March 9, 2012

MDX question about Parameters and two different types of hierarchies....

I was looking at creating cascading parameters within a report I am developing in BIDS.

The parameters I am creating are for an organization structure that looks something like this.

Organization Hierarchy

===========

-Division

-Community

The problem is Division and City are part of a parent child hierarchy inside of a separate DIM named Organization.

Community is part of an attribute hiearachy defined in another DIM named Lot.

I want to be able to filter down the Communitys based upon which Division is selected. The code below returns all Communitys. I try to use a CrossJoin but I cant get it to filter the Communitys down correctly.

Code Snippet

WITH MEMBER [Measures].[ParameterCaption] AS '[Lot].[Community Rollup].CURRENTMEMBER.MEMBER_CAPTION'

MEMBER [Measures].[ParameterValue] AS '[Lot].[Community Rollup].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[Lot].[Community Rollup].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Lot].[Community Rollup].Levels(1) ON ROWS FROM [Cube]

Since Division and Community are in different dimensions, I assume that you want to select Communities with cube data for the selected Division(s). You could try NonEmpty(), like:

WITH MEMBER [Measures].[ParameterCaption] AS '[Lot].[Community Rollup].CURRENTMEMBER.MEMBER_CAPTION'

MEMBER [Measures].[ParameterValue] AS '[Lot].[Community Rollup].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[Lot].[Community Rollup].CURRENTMEMBER.LEVEL.ORDINAL'

SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,

NonEmpty([Lot].[Community Rollup].Levels(1), CrossJoin(StrToSet(@.Community, CONSTRAINED), {[Measures].[FilterMeasure]})) ON ROWS

FROM [Cube]

where [Measures].[FilterMeasure] is a cube measure from the measure group which is used to determine whether a Community has data.

|||Thank you, I will give this a try and let you know how it turns out.

MDX Query with parameters

Hi there,

I'm developing one MDX query to place in my report, but I'm having a lot of troubles when using one of my report parameters.

I hope I can explain me good enough.

I have a report parameter that's used in the WHERE clause to choose the value of one of my dimensions, the problem is that I'm also trying to compare the value of this parameter to decide the value of another dimension, but the comparison isn't working at all.

Let me show one example:

The parameter name in question is: DimFolderWalletDesciption.

Code Snippet


IIF(
@.DimFolderWalletDesciption = [Dim Folder].[Wallet Desciption].&[Investimento],
[Dim Indexation].[Indexation Group].[Rendimento Variável],
[Dim Indexation].[Indexation Group].[Indexation Group].ALLMEMBERS
)


This is suppost to do the following: If my parameter as the selected value "Investimento", then the "Indexation Group" selected should be "Rendimento Fixo" if not, there shouldn't be any "filter" in the Dimension "Indexation Group".

I've tryed a lot of combinations, but none works, what am I doing wrong?

Thanks in advance.
Regards.
Problem solved.

Best regards,

Monday, February 20, 2012

MDX in KPI Value Expression

Hi,

I'm having some problems when developing a couple of KPI's in analysis services. I'd like them to calculate new contracts and renewal of contracts. I have a measure called [Contract Count] which i want to use but i need this to be filtered by the specific contract type member. In my KPI Value expression i have the folowing:

{[Measures].[Contract Count], [Contract].[By Contract Type].[ContractType].&[Renewal]}

I get the following error when i try to run this:

Members belong to different hierarchies in the function

Can anyone suggest what i'm doing wrong. I'm new to MDX and believed that this was the way to get return the required set.

Any help would be much appreciated.

Thanks in advance,

Grant

Hi all,

Apologies, my bad. I've found that i've been using {} instead of () parentheses.

It's working now.

Grant