MDX Query Problem

Post Reply
ravi.ahuja21
Posts: 33
Joined: Tue Aug 30, 2011 8:34 am
OLAP Product: TM1
Version: 9.5
Excel Version: 10.0

MDX Query Problem

Post by ravi.ahuja21 »

Hi freinds,

I am trying to filter out the Nature code using the MDX query, however I am not getting the expected output. I am trying to filter records for Nature code by using the Employee records cube where the Employee measure shift is 1. Is there anything wrong in this MDX query?

I have attached the employee records cube snapshot.Request someone to help me on this. Thank you.

Code: Select all

{Filter(

     {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Central Nature] )}, 0)},
[Employee Records].[Employee Master Measures].[Shift] =1
)
};
Attachments
employeerecords.jpg
employeerecords.jpg (285.11 KiB) Viewed 2235 times
csjean
Posts: 40
Joined: Mon Mar 01, 2010 2:53 pm
OLAP Product: TM1
Version: 9.5 9.5.1 9.5.2
Excel Version: 2007

Re: MDX Query Problem

Post by csjean »

ravi.ahuja21 wrote:Hi freinds,

I am trying to filter out the Nature code using the MDX query, however I am not getting the expected output. I am trying to filter records for Nature code by using the Employee records cube where the Employee measure shift is 1. Is there anything wrong in this MDX query?

I have attached the employee records cube snapshot.Request someone to help me on this. Thank you.

Code: Select all

{Filter(

     {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Central Nature] )}, 0)},
[Employee Records].[Employee Master Measures].[Shift] =1
)
};

Hi,

I believe you are missing the parentheses enclosing you Dimension - Element part of the filter.

Code: Select all

{Filter(
     {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Central Nature] )}, 0)},
[Employee Records].([Employee Master Measures].[Shift]) = 1
)
};
I haven't tested it, but in should work.
Don't forget that the way its written here, you will get all Central Natures
that have an employe Records with a Master Measure.Shift = 1.

The way I see it, laking a more precice description of your problem:

You seem to be getting what you are asking. The Nature code 4301 has employee records with Master Measure . shift = 1 (as does 4101).
If what you want is Nature Codes that have ALL employees with shift = 1 then you should compare (Serial No.Total, Master Measure.Shift) = (Serial No.Total, Master Measure.No of Employees)

This way, you get Central Natures that have the same Total of "shifts" as the number of employees.



Hope this helps.
Cheers!

--
Claude-Sebastien Jean
Senior Consultant in Information Technology
Keyrus Canada
www.keyrus.ca
Post Reply