12 Replies Latest reply: Jan 30, 2014 9:20 AM by adi arnon

dimensions with condition

hi,

i have a straight table with two dimensions.

i want that the table will show only two values of one of the dimensions.

lets say-

my dimension 'country'

the values i want to show 'USA' 'israel'

i tried to put  in the enable condition: if(country='USA' or country='israel',1,0)

its not working.

can someone help me?!

• Re: dimensions with condition

Hi,

Try this  if(country='USA' and country='israel',1,0)

Thank you

Vardhan

• Re: dimensions with condition

Use calculated dimension. something like this

If(match(country,'USA','Israel') > 0,country)

Keep in mind that match is case sensitive.

• Re: dimensions with condition

Why don't you use Set Analysis in your expressions?

Place Country as your Dimension and restrict the Country values using Set Analysis.

Try:

Sum ( {\$< Country= {'USA', 'israel'}>}  ValueField)

• Re: dimensions with condition

Using just Set Analysis in the expressions, the other values will be listed anyway.

• Re: dimensions with condition

Nope if you only have that expression... If you have more than one expression you only have to place the Set Analysis filters in all the other expressions... It's a different approach.

EDIT... Review the attached file.

• Re: dimensions with condition

A calculated dimension like: If(match(country,'USA','Israel') > 0,country) is the solution you are looking for.

• Re: dimensions with condition

and "Suppress When Value is NULL" checked on the Dimension tab. Otherwise you may get three rows.

Peter

• Re: dimensions with condition

Two things:

• Use the following as calculated dimension : =if(match(Country,'USA','Iran'),Country)
• Check the 'Suppress when value is Null' option

Attached is an example

Thanks

AJ

• Re: dimensions with condition

In general it is better to use the proposed set expression solution instead of the calculated dimension. It is better for the performance and you will not loose some of the dimension options (like sort). You will indeed have to include the set expression in all expressions (even some of the expessions as background color of the expression.)

• Re: dimensions with condition

Sum( {\$<Country={'USA','Israel'}>} Sales)