COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => TM1 => Topic started by: missspeedy23 on 11 Apr 2016 07:57:44 AM

Title: MDX Filter
Post by: missspeedy23 on 11 Apr 2016 07:57:44 AM
I have a dimension for year and I only want to show years that are greater than or equal to the current year value which is held in an admin cube - can someone help me with the MDX code for this please?
Title: Re: MDX Filter
Post by: madan3.14 on 13 Jul 2016 06:29:10 AM
Hi - Not Sure if you have already found a way to this , but below solution works, create an attribute on Year dimension and call it in MDX as a filter as shown below:
Dimension = Year in your case
AttributeName = Attribute Name you have created for this purpose

{FILTER({TM1SORT( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dimension)] )}, 0)}, ASC)},
    [}ElementAttributes_Dimension].([}ElementAttributes_Dimension].[AttributeNAme]) = "Y"
)}