5 Replies Latest reply: Oct 6, 2010 10:11 AM by Ronald Calolot

# Problem using Variable in a Dimension, Help on Set Analysis

HI Guys,

I have a dimension that I want to limit using Set Analysis that compares dimension to a Variable.

This code is not working:

[Code]

Only({\$<ProjectName = {\$(vTargetProject)}>} ProjectName}

[/Code]

Also I not sure in using ONLY as function since IF function did not supports set analysis.

Thanks!

• ###### Problem using Variable in a Dimension, Help on Set Analysis

maybe if(vTargetProject = ProjectName, ProjectName)

• ###### Re. :Problem using Variable in a Dimension, Help on Set Analysis

Hello,

If you wan't limit the dimension using the calculate dimension you can use that :

=Aggr(Maxstring ({\$<ProjectName = {"\$(vTargetProject)"} >} ProjectName),ProjectName)

If you wan't limit the dimension using the expression you can use that :

=Sum ({\$<ProjectName = {"\$(vTargetProject)"}>} [My Measure])

• ###### Re. :Problem using Variable in a Dimension, Help on Set Analysis

Hello to all,

Thanks for the quick response.

I'm able to solve my problem using PICARD's solution. I just removed the quotes in a variable.

Also Thanks to Kaushiksolanki for the idea of suppressing null values.

Thanks to all!

regards,

• ###### Problem using Variable in a Dimension, Help on Set Analysis

Hi,

I guess that your ProjectName field is alphanumeric, so you need to quote it in set analysis

`Only({< ProjectName = {'\$(vTargetProject)'} >} ProjectName)`

If vTargetProject has many values, you wil need to concatenate and quote them.

Is this the case?

• ###### Problem using Variable in a Dimension, Help on Set Analysis

HI

I have tried the same with the help of If statement.....

What you have to do is Add Following If statement in dimension.

if(Field_Name = '\$(variable_name)',Field_Name)

After doing these He may Show you entry showing ' - '

To hide that you have to just check on "Suppress When Value is Null"

Try it and let me know if these is working in your application, if not we will find some other solution.....

Regards,

Kaushik