Monday, March 19, 2012

Lookupcube and Parameter not working together

Please help me
I have the following MDx that works perfect, but I need now to attach a
parameter, but it would work. please help
With
Member Measures.[Sales Current Year Target] as
'LookupCube("Sales vs SalesBudget","( [Measures].[Current Year
Target],[DistrictGeo].[District Id].["+[DistrictIsManaged].CurrentMember.Name
+"]," + [Time].CurrentMember.UniqueName + ")")'
SELECT NON EMPTY { Measures.[Sales Current Year Target] } ON COLUMNS ,
{NONEMPTYCROSSJOIN(
{ [DistrictIsManaged].[District Id].[Dallas]},
[Territory].[Territory Desc].members)} on
ROWS
FROM [Sales vs RepBudget]
where (" & Parameters!pTime.Value & ")"You need to prefix your mdx with =" and end with ". And the whole mdx
statement needs to be in on one line. It will break by itself, but you can
check it out by copying the whole statement to Notepad, turn off word wrap
and see that it's all on one line.
Also, you might have to escape the quotes "s in your statement. You do this
by adding more quotes.
"
Visual Basic Language Specification
2.4.4 String Literals
A string literal is a sequence of zero or more Unicode characters beginning
and ending with an ASCII double-quote character, a Unicode left double-quote
character, or a Unicode right double-quote character. Within a string, a
sequence of two double-quote characters is an escape sequence representing a
double quote in the string."
Try adding an extra " infront of you "s.
Kaisa M. Lindahl
"Tomas" <Tomas@.discussions.microsoft.com> wrote in message
news:E32EB005-182D-4315-A873-FF6C6606AFCB@.microsoft.com...
> Please help me
> I have the following MDx that works perfect, but I need now to attach a
> parameter, but it would work. please help
> With
> Member Measures.[Sales Current Year Target] as
> 'LookupCube("Sales vs SalesBudget","( [Measures].[Current Year
> Target],[DistrictGeo].[District
> Id].["+[DistrictIsManaged].CurrentMember.Name
> +"]," + [Time].CurrentMember.UniqueName + ")")'
> SELECT NON EMPTY { Measures.[Sales Current Year Target] } ON COLUMNS ,
> {NONEMPTYCROSSJOIN(
> { [DistrictIsManaged].[District Id].[Dallas]},
> [Territory].[Territory Desc].members)} on
> ROWS
> FROM [Sales vs RepBudget]
> where (" & Parameters!pTime.Value & ")"
>

No comments:

Post a Comment