Page 2 of 2
Re: MDX query for filter
Posted: Tue Apr 30, 2013 6:22 am
by EP_explorer
I tried to explain what I need in many ways.
I hope It wasn't useless attempts.
So Could anybody gives ideas?
Re: MDX query for filter
Posted: Tue Apr 30, 2013 11:53 am
by rozef
Hi EP_explorer,
EP_explorer wrote:Function Filter with "*" doesn't work - return empty selection
Apparently it is trying to find string "*" but not any elements as in FilterbyPattern
Function "FilterbyPattern" doesn't work for cube or alias values indeed.
As I said in some posts before, you have to use INSTR function (which is not documented so it can be not supported in further version)
That will give you something like that:
Code: Select all
{FILTER(
{
TM1FILTERBYLEVEL(
{TM1SUBSETALL( [Time Monthly] )}, 0
)
}
, INSTR( [Time Monthly].CurrentMember.Name , [System Information].([System Information Measures].[FilterVal], [System Information Values].[Value] ) > 0 )
)
Re: MDX query for filter
Posted: Tue Apr 30, 2013 12:48 pm
by EP_explorer
Thank you a lot. It works - except one little thing.
If there are in Cube 1 in list are values
Region
1 Region1
2 Region2
3 Region11
4 Region3
and in Cube 2 user chooses Region1
it shows
Region
1 Region1
3 Region11
of course it is better than nothing but may be ways exists to solve the problem
Re: MDX query for filter
Posted: Tue Apr 30, 2013 1:41 pm
by rozef
I am not sure to know what you want but if it is to let users choosing to use or not wildcard search,
the only solution I have in mind is to add an extra indicator and some basic condition in your filter.
Code: Select all
{FILTER(
{
TM1FILTERBYLEVEL(
{TM1SUBSETALL( [Time Monthly] )}, 0
)
}
,
[System Information].([System Information Measures].[FilterVal], [System Information Values].[WildCard]) = "T"
AND
INSTR( [Time Monthly].CurrentMember.Name , [System Information].([System Information Measures].[FilterVal], [System Information Values].[Value] ) > 0 )
OR
[System Information].([System Information Measures].[FilterVal], [System Information Values].[WildCard]) = "F"
AND
[Time Monthly].CurrentMember.Name = [System Information].([System Information Measures].[FilterVal], [System Information Values].[Value] )
)}
Re: MDX query for filter
Posted: Mon May 06, 2013 1:51 pm
by EP_explorer
Thank you - your last reply was helpful
I did what I wanted