Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

johnsmithqv
New Contributor III

Dimension Properties

Hi,

I have  a scenario where i need to hide the Dimension based on the user selection.

i am attaching the sample app and datasource.

Please provide me the suggestion on this

1 Solution

Accepted Solutions
Employee
Employee

Re: Dimension Properties

any better ?

You can add a conditional show condition on dimensions or measures.

dimension tab, enable conditional:  

if( SubStringCount( concat( distinct Region,';'),'US')>0 or SubStringCount( concat( distinct Region,';'),'Ind')>0, 1,0)

3 Replies
Employee
Employee

Re: Dimension Properties

any better ?

You can add a conditional show condition on dimensions or measures.

dimension tab, enable conditional:  

if( SubStringCount( concat( distinct Region,';'),'US')>0 or SubStringCount( concat( distinct Region,';'),'Ind')>0, 1,0)

Employee
Employee

Re: Dimension Properties

noticed a blank row was showing up when UK was selected with US and ind ... corrected that an uploaded new version.

how it works ?

the whole dimension will be conditionally hidden based on this boolean expression that evaluates to TRUE (1) or FALSE (0)

if( SubStringCount( concat( distinct Region,';'),'US')>0 or SubStringCount( concat( distinct Region,';'),'Ind')>0, 1,0)

the concat() function will create a delimitted list of all 'Region' values in the current selection.

So if you select US, Ind, UK ..

concat( distinct Region,';') will return--->   US;Ind;UK    (; is the delimitter which you can choose but its moot for this purpose)


next part is to test if   'US' or 'Ind' is in that list and we use substringcount(  <list>, 'US')   to check if 'US' is in the list 


If US or Ind is in the list then its a TRUE and assign 1.  Otherwise 0 and hide the whole dimension.


Little tricky but useful one to remember.

johnsmithqv
New Contributor III

Re: Dimension Properties

It works like a champ.

Thanks Alot Jonathan for both your solution and illustration of the work.

A big cheers and hundred thanks to you

Community Browser