select - MDX Builder - filtering with INSTR function -
i totally new in mdx. i'd need filter records containing substring "sbp1". works me when enter each record separately this: {[article].[article alternative id cpg].[sbp1 0],[article].[article alternative id cpg].[sbp1 1],[article].[article alternative id cpg].[sbp1 w]}
working code:
select non empty {[measures].[value]} on columns ,non empty { [article].[article alternative id cpg].[article alternative id cpg].allmembers* [article].[market].[market].allmembers* [article].[brand].[brand].allmembers* [article].[product].[product].allmembers } dimension properties member_caption ,member_unique_name on rows ( select { [article].[article alternative id cpg].[sbp1 0] ,[article].[article alternative id cpg].[sbp1 1] ,[article].[article alternative id cpg].[sbp1 w] } on columns ( select {[measure data type].[data type].[actuals]} on columns ( select {[org sales area].[sales organization key].[deb1]} on columns ( select {[org sales area].[distribution channel].&[do]} on columns ( select {[org business unit].[business unit].[u-k]} on columns ( select {[measure item].[measure item].&[kf00310]} on columns ( select {[date of posting].[posting y q m d].[posting year].&[2017]} on columns [color lean cpg] ) ) ) ) ) ) ) ( [date of posting].[posting y q m d].[posting year].&[2017] ,[measure item].[measure item].&[kf00310] ,[org business unit].[business unit].[u-k] ,[org sales area].[distribution channel].&[do] ,[org sales area].[sales organization key].[deb1] ,[measure data type].[data type].[actuals] ) cell properties value ,back_color ,fore_color ,formatted_value ,format_string ,font_name ,font_size ,font_flag;
how more efficient instr function? tried doesn't work:
select [measures].[value] on columns ,filter ( [article].[article alternative id cpg].[article alternative id cpg].allmembers , instr ( [article].[article alternative id cpg].[article alternative id cpg].currentmember.name ,'sbp1' ) > 0 ) on rows [color lean cpg];
what wrong on mdx statament? mdx select screenshot thank you
i think might have navigated little far when applying currentmember
function. try this:
select [measures].[value] on columns ,filter ( [article].[article alternative id cpg].[article alternative id cpg].allmembers , instr ( [article].[article alternative id cpg].currentmember.name //<<[article].[article alternative id cpg].[article alternative id cpg].currentmember.name ,'sbp1' ) > 0 ) on rows [color lean cpg];
hopefully name works go membercaption
:
select [measures].[value] on columns ,filter ( [article].[article alternative id cpg].[article alternative id cpg].allmembers , instr ( [article].[article alternative id cpg].currentmember.membercaption ,'sbp1' ) > 0 ) on rows [color lean cpg];
Comments
Post a Comment