Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
JonnyPoole
Former Employee
Former Employee

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)

View solution in original post

3 Replies
JonnyPoole
Former Employee
Former Employee

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)

JonnyPoole
Former Employee
Former Employee

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.

Anonymous
Not applicable
Author

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