Mdx query
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Mdx query
hi All,
I am new to MDX queries and I try to write these codes on Performance Modeler expression window but ı got "Invalid Subset Expressions" error. Any one can help please?
I copied the code from the ınternet but i didnt work . I think there is no syntax problem but..
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [3_Sira_No] )}, 0)},
[z_Krediler_Fiili].([1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON]) > 0 )}
I am new to MDX queries and I try to write these codes on Performance Modeler expression window but ı got "Invalid Subset Expressions" error. Any one can help please?
I copied the code from the ınternet but i didnt work . I think there is no syntax problem but..
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [3_Sira_No] )}, 0)},
[z_Krediler_Fiili].([1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON]) > 0 )}
- Steve Rowe
- Site Admin
- Posts: 2417
- 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: Mdx query
You need to have an explicit reference to all the dimensions in the cube, except the one you are querying against. Unless the cube z_Krediler_Fiili only has the two dimensions 3_Sira_No and KREDILER_ISTIRAK_ELIMINASYON then you need more references in the cube query part
"[z_Krediler_Fiili].([1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON], [dim].[element] , ....) "
"[z_Krediler_Fiili].([1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON], [dim].[element] , ....) "
Technical Director
www.infocat.co.uk
www.infocat.co.uk
-
- MVP
- Posts: 3120
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: Mdx query
Also, did you check that you get the correct results if you leave out the part with Filter ?
Work from the inside to the outside and test every part of the MDX formula.If it works, add the next part to it.
Work from the inside to the outside and test every part of the MDX formula.If it works, add the next part to it.
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
Thanks for reply.
My cube has 3 dimension
3_Sira_No ( 1,2,3,4,5,6,7,......)
4_Aylar(31.10.2016, 30.09.2016,...)
1_Krediler( KREDILER_ISTIRAK_ELIMINASYON, Curreny, Balance,...)
I try to do that if KREDILER_ISTIRAK_ELIMINASYON value is >0, ı want to see at the 3_Sira_No dimension .
I wrote This one ;
{ FILTER( {TM1SUBSETALL ( [3_Sira_No] ) }
[z_Krediler_Fiili].([4_Aylar].[31.10.2016],[1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON]) > 0 ) }
This is what you mean Steve?
And also you are right Wim . İts is better to start with small pieces.
My cube has 3 dimension
3_Sira_No ( 1,2,3,4,5,6,7,......)
4_Aylar(31.10.2016, 30.09.2016,...)
1_Krediler( KREDILER_ISTIRAK_ELIMINASYON, Curreny, Balance,...)
I try to do that if KREDILER_ISTIRAK_ELIMINASYON value is >0, ı want to see at the 3_Sira_No dimension .
I wrote This one ;
{ FILTER( {TM1SUBSETALL ( [3_Sira_No] ) }
[z_Krediler_Fiili].([4_Aylar].[31.10.2016],[1_Krediler].[KREDILER_ISTIRAK_ELIMINASYON]) > 0 ) }
This is what you mean Steve?
And also you are right Wim . İts is better to start with small pieces.
- Steve Rowe
- Site Admin
- Posts: 2417
- 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: Mdx query
Hi Yes, that looks to be the correct form but I can't check the syntax in detail.
Technical Director
www.infocat.co.uk
www.infocat.co.uk
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
But when ı write these codes . I got an error Invalid Subset Expression. But ı am sure do not have syntax error.
- Steve Rowe
- Site Admin
- Posts: 2417
- 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: Mdx query
In the second example you are missing a comma between the two lines, not sure if this is a typo or not?
Technical Director
www.infocat.co.uk
www.infocat.co.uk
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
Yes , you are right.
{ FILTER( {TM1SUBSETALL( [3_Sira_No] )},
z_Krediler_Fiili.([4_Aylar].[31.10.2016],[1_Krediler].[DOVIZ]) = "TRY" )}
I write this one. As I see, when there is a syntax error even you can not apply it. There is someting wrong what ı write.
My code can not read the value TRY which is currency. I am missing someting but ı coulnt get it.
{ FILTER( {TM1SUBSETALL( [3_Sira_No] )},
z_Krediler_Fiili.([4_Aylar].[31.10.2016],[1_Krediler].[DOVIZ]) = "TRY" )}
I write this one. As I see, when there is a syntax error even you can not apply it. There is someting wrong what ı write.
My code can not read the value TRY which is currency. I am missing someting but ı coulnt get it.
-
- MVP
- Posts: 1815
- 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: Mdx query
Your cube name should be in square brackets.AliUgur wrote:Yes , you are right.
{ FILTER( {TM1SUBSETALL( [3_Sira_No] )},
z_Krediler_Fiili.([4_Aylar].[31.10.2016],[1_Krediler].[DOVIZ]) = "TRY" )}
I write this one. As I see, when there is a syntax error even you can not apply it. There is someting wrong what ı write.
My code can not read the value TRY which is currency. I am missing someting but ı coulnt get it.
Declan Rodger
- Steve Rowe
- Site Admin
- Posts: 2417
- 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: Mdx query
Suggest you google "MDX_Primer New Version" and use this as a base for the syntax, it has many excellent examples.
Technical Director
www.infocat.co.uk
www.infocat.co.uk
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
You are right declanr
{ FILTER( {TM1SUBSETALL( [3_Sira_No] )},
[z_Krediler_Fiili].([4_Aylar].[31.10.2016],[1_Krediler].[DOVIZ]) = "TRY" )}
ı corrected it. But still getting error "Invalid expression" I wrote this code to dimension [3_Sira_No] expression window is it right?
{ FILTER( {TM1SUBSETALL( [3_Sira_No] )},
[z_Krediler_Fiili].([4_Aylar].[31.10.2016],[1_Krediler].[DOVIZ]) = "TRY" )}
ı corrected it. But still getting error "Invalid expression" I wrote this code to dimension [3_Sira_No] expression window is it right?
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
I think I solved the problem. My "3_Sira_No" dimension's elements are 1,2,3,4,5,6,....., 21.000.000 or maybe little more:)
Thats why mo codes are right but dimension is big. Thats why mdx can not run on this dimension.
What do you think guys?
Thats why mo codes are right but dimension is big. Thats why mdx can not run on this dimension.
What do you think guys?
-
- MVP
- Posts: 1815
- 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: Mdx query
I've never heard of TM1 giving an invalid expression message for a dimension being large before; I have seen it accept the code and lock up while it tries to work it but never say its invalid. That being said I have never tried writing MDX in performance modeler before either.AliUgur wrote:I think I solved the problem. My "3_Sira_No" dimension's elements are 1,2,3,4,5,6,....., 21.000.000 or maybe little more:)
Thats why mo codes are right but dimension is big. Thats why mdx can not run on this dimension.
What do you think guys?
Try writing it in an architect subset editor window and it may give you a slightly different more detailed error message (it also might not but its worth a go.)
Declan Rodger
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
IBM didnt say about anything dimension size. That's my opinion actually. Sorry for that explaniton.
I checked the code in another small cube it worked perceftly.
I tried the code at performance modeler and architect. But same exact error I got.
I will make a small video. and will send it here. Cause maybe ı do someting wrong and ı want to learn the reason. Thanks for reply declanr.
I checked the code in another small cube it worked perceftly.
I tried the code at performance modeler and architect. But same exact error I got.
I will make a small video. and will send it here. Cause maybe ı do someting wrong and ı want to learn the reason. Thanks for reply declanr.
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
I tried to take a video of the mdx . Can you please check what ı do wrong about it?
- Attachments
-
- Recording #1.rar
- (2.36 MiB) Downloaded 214 times
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
As you said I checked the TM1 architect errors and ı found someting like on the file.
- Attachments
-
- Capture.PNG (12.15 KiB) Viewed 9539 times
-
- MVP
- Posts: 1815
- 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: Mdx query
It appears that you were correct and it is size related.
I thiught you had meant it would not allow you to save the expression but the video shows thatbit is valid. You are however unable to see the list on your PC - using the MDX in a TI would prove that the expression is correct.
I thiught you had meant it would not allow you to save the expression but the video shows thatbit is valid. You are however unable to see the list on your PC - using the MDX in a TI would prove that the expression is correct.
Declan Rodger
-
- Posts: 58
- Joined: Tue Aug 05, 2014 2:13 pm
- OLAP Product: TM1
- Version: TM1 10.2.2
- Excel Version: Excel 2013
Re: Mdx query
I checked the code . It is correct and ı learned MDX:)
Thanks to everybody for sharing knowledge...
Thanks to everybody for sharing knowledge...