Instruction manuals

TM1 - MDX Primer Calculo

Description
Guia para el aprendizaje de MDX en TM1.
Published
of 20
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  CREATING DYNAMIC SUBSETS IN APPLIX TM1USING MDX Last updated: 14 th  April 2008Lead author: Philip Bichard. Contact for feedback, uestions or to reuest updates. Additional !aterial: !artin indon.   TABLE OF CONTENTS CREATING DYNAMIC SUBSETS IN APPLIX TM1 USING MDXTABLE OF CONTENTS ..................................................................1 HOW TO CREATE A MDX-BASED SUBSET IN TM1 ..........................................................................................................................3 HOW TO CREATE A STATIC SUBSET WITH MDX .............................................................................................................................3 HOW TO CREATE A DYNAMIC SUBSET WITH MDX ........................................................................................................................4 SYNTAX AND LAYOUT ........................................................................................................................................................................4 THE EXAMPLE MODEL USED .............................................................................................................................................................5 TM1SUBSETALL, MEMBERS, MEMBER RANGE ...............................................................................................................................5 SELECT BY LEVEL, REGULAR EXPRESSION (PATTERN) AND ORDINAL ......................................................................................6 TM1SORT, TM1SORTBYINDEX AND ORDER ....................................................................................................................................6 TOPCOUNT AND BOTTOMCOUNT .....................................................................................................................................................7 FILTER, BY VALUES, STRINGS AND ATTRIBUTES ...........................................................................................................................7 PARENT, CHILDREN, FIRSTCHILD, LASTCHILD, ANCESTORS, DESCENDANTS, DRILLDOWNLEVEL AND TM1DRILLDOWNMEMBER .................................................................................................................................................................8 LAG, LEAD, NEXTMEMBER, PREVMEMBER, FIRSTSIBLING, LASTSIBLING, SIBLINGS AND LASTPERIODS ..........................9 FILTERING BY CURRENTMEMBER, NAME, NEXTMEMBER, PREVMEMBER, ANCESTOR AND FIRSTSIBLING ......................10 FILTERING BY ATTRIBUTES AND LOGICAL OPERATORS .............................................................................................................10 HEAD, TAIL AND SUBSET .................................................................................................................................................................11 UNION .................................................................................................................................................................................................11 INTERSECT .........................................................................................................................................................................................11 EXCEPT AND VALIDATING DIMENSION HIERARCHIES ................................................................................................................11 TOGGLEDRILLSTATE .........................................................................................................................................................................13 USING TM1 SUBSETS, TM1MEMBER, TM1SUBSETTOSET AND ITEM .......................................................................................14 USERNAME AND STRTOMEMBER ...................................................................................................................................................15 SUM, AVG AND STDEV .....................................................................................................................................................................16 USING PARAMETERS IN QUERIES ..................................................................................................................................................17 GENERATE ..........................................................................................................................................................................................18 COUNT AND IIF .................................................................................................................................................................................18 COMMENTS ........................................................................................................................................................................................18 - 2 / 20 -  Ab! T#$% D&!'()  T#$% MDX P*$'(* $% $) ()+(+  %(*,( -% - %$'/( $) *+!& $)  &*(- $) +)-'$& +$'()%$) %!b%( % !%$) MDX $) TM1.   I 2&!%(% ) $,$) *$) (-'/(% *- #(* #-) *$)  (/-$) #( &'/( ( #(* 2 MDX -)+ '-(% %!*(  &,(* #(2(- !*(% '% !%(2!/  TM1 !%(*%.  TM1 &!**() / -% 2 9.0 SP )/ -//% !%(*%  !%( MDX  &*(- ( +$'()%$) %!b%( % -)+ )  +()( &!b( ,$(%. T#$% '(-)% #- #( !%-( 2 MDX $) TM1 $% 2 () :!$ ( +$;(*() $) (*'% 2 b # %) - -)+ $) () $) 2*' (-'/(% 2!)+ $) b% -)+ ) #( $) (*)( .A% MDX M!/ $<D$'()%$)-/ (X*(%%$)% $% -) $)+!% *<% -)+-*+ :!(* /-)!-( 2* OLAP +- -b-%(% 2*' M$&*%2 #(*( -*('-) *(2(*()&(% -)+ (-'/(%  b( 2!)+ ) #( I) (*)( = #!# b(-* $) '$)+ #- TM1 +(%)> %!* (,(* -%(& 2 #(/-)!-( -)+ -++% - 2( !)$:!( 2(- !*(% 2 $ % ). T#$% &-) '-( $ +$?&!/  !%( (-'/(% 2!)+ ) #( (b= #(*(-% -// #((-'/(% $) #$% +&!'() &-) %$'/ b( &$(+<-)+<-% (+ $)  TM1 -)+ $// ((&! ( $ #! '+$&- $)= -%%!'$) ! #-,( #( (-'/( '$)$<'+(/ &*(- (+ -% +&!'() (+ /- (*. @#- $% - MDX<b-%(+ +)-'$& %!b%( $) TM1 A +)-'$& %!b%( $% )( #$&# $% ) - (+= % - $&= /$% b! $)% (-+ $ $% b-%(+ ) - :!(* #$&# $% *(<(,-/!- (+ (,(* $'( #(%!b%( $% !%(+. I) 2-& = MDX &!/+ b( !%(+  &*(- ( - % - $& %!b%( -)+ -) (-'/( $% %#) b(/= b! #$% !)/$(/  b( !%(2!/* &'').S'( (-'/(% 2 !%(2!/ +)-'$& %!b%( % '$# b( - /$% 2 -// b-%(</(,(/ *+!& % - /$% 2 !* T 10 &!% '(*% b *%%'-*$) - /$% 2 ,(*+!( %!/ %#$'() % -// &% &() *(% # #-,( ) ( %!b'$ (+ #($* b!+( . T#( $) $%= #(%( /$% %%!b%( % '- ,-* 2*' %(&)+  %(&)+ b-%(+ ) #( % *!& !*( * +- - $) TM1. F* (-'/(= -% %) -% - )( b*-)&# $% -++(+  E!*(= #( E!*(-) B*-)&#(% %!b%( $// $''(+$- (/ &) -$) #$% )( b*-)&#= $ #! -) '-)!-/ $) (*,() $) )((+(+.MDX $% #( :!(* /-)!-( !%(+  +()( #(%( %!b%( %. MDX $% -) $)+!% *<% -)+-*+ :!(* /-)!-( 2* '!/ $<+$'()%$)-/+- -b-%(% /$( TM1= -/ #!# TM1 )/ %!* % - &(* -$) %!b%( (&!%( #( !) 2 #( () $*( /-)!-( -)+ -++% $) - 2(!)$:!( 2(- !*(% 2 $ % ) -% (//. @#() ! +()( - %!b%( !%$) MDX $)% (-+ 2 - % -)+-*+ %!b%( = TM1 % *(% #$% +()$ $)*- #(* #-) #( *(%!/ $) %( . T#$% '(-)% #( +()$ $)  * :!(*  $% *(<*!) (,(* $'( ! / - $  $ #! #( !%(* *-+'$)$% *- * )((+$)  + -) #$) - -//. I2 #( +- -b-%( #-% &#-)(+ $) %'( - #() ! '- ( +$;(*() *(%!/ % 2*' #(/-% $'( ! !%(+ $ . F* (-'/(= $2 - %!b%( $% +()(+ -% b($)  #( &#$/+*() 2 @(% C-% B*-)&#(% -)+ #$% $)$ $-// *( !*)%O-/-)+= S-) F*-)&$%&= S-) D$( #() $ $% *% +()(+= $ '- /- (* *( !*) O-/-)+= S-) F*-)&$%&= S-) D$(= L% A)(/(%)&( LA #-% b(() -++(+ $)  #( +$'()%$) -% - &#$/+ 2 @(% C-% B*-)&#(%. T#$% $% #- ( '(-) b +)-'$&  #( *(%!/ &#-)(%. A) #(* *(-%) #- &-) &-!%( #( %!b%(  &#-)( $% #() $ $% b-%(+ ) #( #alues  $ #$) - &!b( * - *$b! (. E,(*+- $) #( )(%-(* #( b$(% % & '-*( ',(*% -*( /$% (+= %!&# -% -  10 $) (*'% 2 %#-*( *$&( *$%(. I) - TM1 '+(/ #$% !/+ b( - %!b%( /$) - - %#-*( *$&( &#-)( '(-%!*( -)+ &/(-*/ !/+ b( /$(/  *( !*) - +$;(*() %( 2 10'('b(*% (,(* +-. T#( b(% -* $% #- #( %!b%( $// !+- (% $ % *(%!/ % -! '- $&-// $ #! -) * )((+(+ ) #( -* 2 - !%(*.O@ TO CREATE A MDX<BASED SUBSET IN TM1 T#( %-'( b-%$& % (% &-) b( 2//(+ $ # -// #( (-'/(% $) #$% +&!'() . G()(*-// #( (-'/(% &-) b( &<-)+<-% (+$)  #( E*(%%$) @$)+ 2 #( S!b%( E+$ * 2 #( +$'()%$) $) :!(% $)  2 () P*+!& . N ( #- $ $% $**(/(,-) #$&# &!b( #( +$'()%$) $% b($) !%(+ b ! $// ( %-'( *(%!/ % #( #(* ! () #( +$'()%$) S!b%( E+$ * 2*' $ #$) - &!b( ,$(= #( &!b( *(( $) S(*,(* E/*(* * #( +$'()%$) *(( $) S(*,(* E/*(*.I) *+(*  ,$( -)+ (+$ -) MDX :!(* ! '!% b( -b/(  %(( #( E*(%%$) @$)+ $) #( S!b%( E+$ *. T /( #$%$)+ ) -)+ ; &#%( $( H E*(%%$) @$)+. Y! &-) ) !% ( *-% ( !* :!(* $)  #$% E*(%%$) @$)+-)+ *(%% #( U+- (b! )  %(( #( *(%!/ %. - 3 / 20 -  O@ TO CREATE A STATIC SUBSET @IT MDXA % - $& %!b%( $% )( #$&# )(,(* ,-*$(% $) $ % &) () . T#$% :!(* $// *( !*) #( %-'( 3 '('b(*% D$%&!) L-)= T(*' L-) -)+R( -$/ (,(* $'(.J KP*+!& .KD$%&!) L-)= KP*+!& .KT(*' L-)= KP*+!& .KR( -$/ D)> **= $ ( % '*( (&$ $) 2*' #(*(.O@ TO CREATE A DYNAMIC SUBSET @IT MDX TM1 )/ %!* % - &(* -$) )!'b(* 2 2!)& $)% 2*' #( &'/( ( MDX %(&$&- $). D$;(*() ,(*%$)% 2 TM1 $// %!* +$;(*() 2!)& $)% -)+  () $-// %!* #( $) +$;(*() -%. T#( ,-/$+ %( 2 2!)& $)% 2* #( ,(*%$) 2 TM1 #- ! -*(!%$) &-) b( 2!)+ $) #( '-$) (/ /(= !)+(* R(2(*()&( M- (*$-/ H MDX F!)& $) S!* . B(2*( *$)  *$ ( - )( :!(*='-( %!*( $ $% %!* (+= -)+ -/ #!# %'( !)/$% (+ 2!)& $)% &(* -$)/ + * #( '!% b( !%(+ - !* ) *$%. T#(% -)+-*+ (*** '(%%-( #$&# '(-)% #( 2!)& $) $% ()!$)(/ ) %!* (+ b !* ,(*%$) 2 TM1 $%= F-$/(+  &'$/((*(%%$).O)( *+ 2 -*)$) b $ % ,(* )- !*(= #( *(%!/ % 2 - +)-'$& %!b%( &-) &#-)(. @#() $)&/!+$) +)-'$& %!b%( % $) ,$(%=*&(%%(%= S!b)' 2!)& $)%= -)+ % 2* #= &)%$+(* &-*(2!// #- #(  () $-/ 2! !*( *(%!/ % '$# b(= (%(&$-// $2 #( %!b%( &!/+ )( +- b( (' . T#(  '% &'') '( #+%   -b! -& !-// &*(- $) - +)-'$& %!b%( -*(  &*(- ( #(' b#-)+ * !%$) T!*bI) (*- *. By h! . Y! &-) ($ #(* ( * -% ( - :!(* $)  #( E*(%%$) @$)+ -% (/-$)(+ (-*/$(*= * ! &-) &#%( T/% HR(&*+ E*(%%$) -)+ #() S  R(&*+$) #() +)(  !*) ) - $)+ 2 ,$+( *(&*+(*. Y! &-) #() !%( #( )*'-/ 2(- !*(%2 #( %!b%( (+$ * (.. %(/(& b /(,(/= %* +(%&()+$)= ( &. -)+ #$% *(&*+(* $// !*) !* -& $)% $)  - ,-/$+ MDX(*(%%$). T#$% $% - *(- -  %(( %'( (-'/(% 2 ,-/$+ %) -= (%(&$-// 2* '*( &'/( :!(*$(%. @#() ! #-,( b(() *(&*+$) -) (*(%%$) -)+ &#%( S  R(&*+$) TM1 $// -% !  &)*' $2 ! $%#  - -&# #((*(%%$) $ # #( %!b%( < '-( %!*(  %- Y(%> -)+ $& #( S-,( E*(%%$)> &#(&b #() %-,$) #( *(%!/ $) %!b%( = #(*$%( )/ - % - $& /$% 2 #( *(%!/ $% %-,(+= ) #( +)-'$& :!(* $ %(/2. U#$!% T&'I!*+%'*' . O)/ )( /$)(= !%$) S!b%( C*(- (BMDX= $% )((+(+  &*(- ( -)+ +()( #( %!b%( . Y! $// )((+ ) #- :!(* ! -) -% #( +()$ $) -/*(-+. N ( #- #( :!(* &-) b( b!$/ ! $) #( TI %&*$ !%$) ( &)&- ()- $)% &-) $)&**- ( ,-*$-b/(% 2*' !* %&*$ -)+ -// /) :!(*$(%  b( b!$/ ! $) % -(% #$&# -*( (-%$(*  *(-+ -)+'-$) -$).  S&#+*C'+*+yMDX  QB-%( P*+!& %Q=QJ TM1FILTERBYLEVEL  J TM1SUBSETALL  KP*+!& = 0Q  All $%&created !'( subsets are sa#ed as d)na*ic !'( ueries auto*aticall) and not as a static list. N ( #- = - /(-% !  TM1 ,9.0 SP= MDX<b-%(+ %!b%( % &-)) b( +(% *(+ S!b%( D(% * $2 #( -*( b($) !%(+ b -!b/$& ,$(= -)+ #( &-)) b( *(&*(- (+ b !%$) - %(&)+ S!b%( C*(- (BMDX &''-)+. T#(*(2*( $ $% +$?&!/  -'()+MDX<b-%(+ %!b%( % !%$) TI. @#$/( #( +)-'$& )- !*( 2 #( %!b%( +()$ $) '- '-( $ %'(#- !)/$(/ ! $// -& !-//-)  + #$%= $ $% $'* -)  b(-* $) '$)+. I2 ! )((+  &#-)( %'( -%(& 2 #( :!(* (.. - TM1F$/ (*B P- (*) 2*'006<1  007<01 ! '- #-,(  +()( #( :!(*  !%( ( (*)-/ -*-'( (*%= -% +&!'() (+ $) #$% +&!'() . T#$%$// #-,( - %'-// (*2*'-)&( $'-& ,(* #( %$'/(* #-*+&+(+ ,(*%$). N*+ *h* TI h#  $$* . /0 2h'2*+'# .' +3!$!% MDX #&#+*#, * +#* &4 * 5671 SP/, 8h$2h 2! + 9&$*+ $$*$!% . SYNTAX AND LAYOUTA :!(* &-) b( b*() ,(* '!/ $/( /$)(%  '-( $ '*( *(-+-b/(. T#$% (-'/(JFILTER JTM1FILTERBYLEEL JTM1SUBSETALLKP*+!& = 0=  T(% .KR- ( M(-%!*(%.KR- (  19 I% '*( *(-+-b/( #-) #-,$) #( #/( :!(* $) )( /$)(. T#( -& !-/ / (* %(& $) $% '*( (-%$/ *(-+ -)+ '+$(+ ) b#-,$) $ ) - /$)( b $ %(/2.N ( #- *(2(*()&(%  '('b(*% !%!-// #-,( #( +$'()%$) )-'( -% - *(. F* (-'/(= J JKP*+!& .KR( -$/.C#$/+*() I) 2-& #( +$'()%$) )-'( $%  $)-/  b! )/ $2 #( '('b(* )-'( R( -$/ $) #$% &-%( $% &'/( (/ !)$:!( $ #$) #( () $*(%(*,(*  $.(. #(*( -*( ) &!b(%= +$'()%$)% * '('b(*% $ # #- (-& )-'(. F* (-'/( #$% $% #( %-'( :!(* $ # #( +$'()%$) )-'( '$ (+J JKR( -$/.C#$/+*() @#$&# !/+ * $) #( &) ( 2 #( %-'/( -/$&- $) !%(+ b #$% +&!'() b! !/+ b( *$% $) - *(-/<*/+ -/$&- $). T#( (*** '(%%-( *(&($,(+ #() 2*( $)  %(&$2 #( *( !/+ b( %'( #$) /$(= L(,(/ * '('b(* )-'( KR( -$/-'b$!!% 2!)+ $) +$'()%$)% -)+ #() $ (% )  /$% #( ,-*$!% +$'()%$)% $) #$&# #( ))<!)$:!( '('b(* )-'( &-)b( 2!)+= #$&# $% ,(* #(/2!/. I $% #(*(2*( &(* -$)/ %-2(% -)+ '% (*2*'-)  -/-% !%( #( +$'()%$) *(.  T#( !%( 2 %:!-*( b*-&( % &-) %'( $'(% %((' - b$ -*b$ *-* #() *(-+$) (-'/(% 2 MDX :!(*$(%. T#( 2-& $% #- -) OLAPb(& )-'( (.. &!b( )-'(= +$'()%$) )-'(= '('b(* )-'( '!% b( ()&/%(+ $) %:!-*( b*-&( % )/ $2 $ &) -$)% - %-&(=% -* % $ # - )!'b(* * $% -) MDX *(%(*,(+ *+ (.. S(/(& . (,(*= %'( $'(% $ &-) b( %$'/(*  +(&$+(  -/-% !%(b*-&( % % %$'$/-* :!(*$(% &-) b( &'-*(+ %$+( b %$+( '*( (-%$/.  T#( (-& +()$ $) 2 - '('b(* $) TM1 $% -/'% -/-% (*(%%(+ -% KD$'()%$) N-'(.KM('b(* N-'( -)+ ) '*(. I)  #(**+!& % #- -/% !%( MDX -% - :!(* /-)!-( %!&# -% M$&*%2 A)-/%$% S(*,$&(% ! '- ) $&( #- :!(*$(% %(&$& #( 2!//- #> 2*' #( +$'()%$) )-'( #*!# #( #$(*-*&# +)  #( '('b(* )-'(= 2* (-'/( - 4 / 20 -
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks