Reference Parameter to MDX Query from a Excel Cell

Post Reply
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Reference Parameter to MDX Query from a Excel Cell

Post by Abinaya »

Hi
When I reference using the Format " & F16 & " it's not working? What is the correct format?
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Reference Parameter to MDX Query from a Excel Cell

Post by EvgenyT »

"&I10&" is correct format, yeah.

Please post your mdx ...

ET
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Reference Parameter to MDX Query from a Excel Cell

Post by Abinaya »

{FILTER( {TM1SUBSETALL( [Customer] )},[Customer] .Group=" &F16&")}


When I hard code the the Group it works.
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Reference Parameter to MDX Query from a Excel Cell

Post by EvgenyT »

Abinaya wrote:{FILTER( {TM1SUBSETALL( [Customer] )},[Customer] .Group=" &F16&")}


When I hard code the the Group it works.
Ah ok. you gota use ' " & F16 &" ' ... Single, double, ampersand...

Because, I bet you when you look at your MDX string:
Abinaya wrote:{FILTER( {TM1SUBSETALL( [Customer] )},[Customer] .Group=" &F16&")} doesnt have ' ' around the value and MDX engine requires value to be in ' ' when you are filtering by attribute for example hence need for ' " & & " ' syntax

ET
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Reference Parameter to MDX Query from a Excel Cell

Post by Abinaya »

Sorry Still not working. Very strangely when I tried Text(F16,"") in the cell it worked.
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Reference Parameter to MDX Query from a Excel Cell

Post by EvgenyT »

Abinaya wrote:Sorry Still not working. Very strangely when I tried Text(F16,"") in the cell it worked.
So you tried {FILTER( {TM1SUBSETALL( [Customer] )},[Customer].[Group]= '"&F16&"')} ?

see simple example below
Attachments
Untitled.png
Untitled.png (12.87 KiB) Viewed 8855 times
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Reference Parameter to MDX Query from a Excel Cell

Post by Abinaya »

Worked. Sorry for the confusion.
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Reference Parameter to MDX Query from a Excel Cell

Post by Abinaya »

Thanks
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Reference Parameter to MDX Query from a Excel Cell

Post by EvgenyT »

All good.

' " & Cell Reference &" ' is a trick to use ;)


ET
Post Reply