TM1 MDX with AND/OR statement

Post Reply
hpansar
Posts: 17
Joined: Fri Apr 19, 2013 6:50 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2013

TM1 MDX with AND/OR statement

Post by hpansar »

Hi Everyone,

Im trying to include another piece to my MDX statement that has a measure called "Exclude". So far my MDX statement is as as follows:

{FILTER({TM1SUBSETALL([PPD_Fixed Cost Account])}, [PPD_Fixed Cost Mapping].( [FPS_Department].[161003], [PPD_Fixed Cost Mapping Measure].[BLI Flag]) >0)}

I also want to add to the MDX that has [PPD_Fixed Cost Mapping Measure].[Exclude] <> 'Y'. Im assuming there is an AND or an OR statement. I am stuck so any help would be much appreciated.

thanks

Hiten
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: TM1 MDX with AND/OR statement

Post by declanr »

hpansar wrote:Hi Everyone,

Im trying to include another piece to my MDX statement that has a measure called "Exclude". So far my MDX statement is as as follows:

{FILTER({TM1SUBSETALL([PPD_Fixed Cost Account])}, [PPD_Fixed Cost Mapping].( [FPS_Department].[161003], [PPD_Fixed Cost Mapping Measure].[BLI Flag]) >0)}

I also want to add to the MDX that has [PPD_Fixed Cost Mapping Measure].[Exclude] <> 'Y'. Im assuming there is an AND or an OR statement. I am stuck so any help would be much appreciated.

thanks

Hiten
For "AND" you just wrap the extra filter by around it (or inside it) etc.

For "OR" you can use union. It is also discussed quite extensively on this forum.


Start reading this for reference:
http://www.bihints.com/book/export/html/68
Declan Rodger
ardi
Community Contributor
Posts: 165
Joined: Tue Apr 02, 2013 1:41 pm
OLAP Product: tm1, cognos bi
Version: from TM1 9.4 to PA 2.0.9.6
Excel Version: 2010
Location: Toronto, ON

Re: TM1 MDX with AND/OR statement

Post by ardi »

hpansar wrote:Hi Everyone,

Im trying to include another piece to my MDX statement that has a measure called "Exclude". So far my MDX statement is as as follows:

{FILTER({TM1SUBSETALL([PPD_Fixed Cost Account])}, [PPD_Fixed Cost Mapping].( [FPS_Department].[161003], [PPD_Fixed Cost Mapping Measure].[BLI Flag]) >0)}

I also want to add to the MDX that has [PPD_Fixed Cost Mapping Measure].[Exclude] <> 'Y'. Im assuming there is an AND or an OR statement. I am stuck so any help would be much appreciated.

thanks

Hiten
Did you try:

{FILTER({TM1SUBSETALL([PPD_Fixed Cost Account])}, [PPD_Fixed Cost Mapping].( [FPS_Department].[161003], [PPD_Fixed Cost Mapping Measure].[BLI Flag]) >0 OR [PPD_Fixed Cost Mapping].( [FPS_Department].[161003], [PPD_Fixed Cost Mapping Measure].[Exclude]) <> "Y")}
Ardian Alikaj
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: TM1 MDX with AND/OR statement

Post by Steve Rowe »

I've found Except really useful in this type of situation allowing you to subtract one subset from another.
The MDX primer is (should be) required reading for any developer, an excellent piece of work!
Technical Director
www.infocat.co.uk
Post Reply