Qlik Community

Community Corner

Discussion board for questions about the Qlik Community, its features, sharing information, general discussions and even some fun. This is for both new and longtime community members. Everyone is welcome!

adiarnon
Contributor III

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?!

1 Solution

Accepted Solutions
iktrayanov
Contributor III

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.

12 Replies
Not applicable

Re: dimensions with condition

Hi,

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

Thank you

Vardhan

iktrayanov
Contributor III

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.

Partner
Partner

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)

Partner
Partner

Re: dimensions with condition

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

Partner
Partner

Re: dimensions with condition

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

Partner
Partner

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

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

Peter

Not applicable

Re: dimensions with condition

Hi Adi,

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

Not applicable

Re: dimensions with condition

This is informative. Thanks for sharing it. Didn't know about this.