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: 
Not applicable

Masking or blinding dimension names

Hello,

I am developing an application and need the ability to mask or blind the dimension names for all dimension names with the exception of the dimension value selected.  In my use case below I have a bar chart with a dimension called Department with the following dimension values (Finance, IT, Customer Service, Shipping).  I then select the Finance Department and I would like the bar chart to show Finance as it is the value selected, but would then like to mask the other three departments to show as Dept 1, Dept 2 and Dept 3.

I have tried to add a calculated dimension, but it does not provide the result I am looking for.  Below is an example of what I am trying to achieve. 

Can someone provide a solution to my problem?

Thanks!

DimensionMasking.JPG

20 Replies
Not applicable
Author

Excellent, Thank you!  Exactly what I needed.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You're supposed to mark my answer "Correct", not yours

Not applicable
Author

Sorry about that, I corrected.

Not applicable
Author

I have one additional use case that I need to be able to support.  I have added an additional column in my Edit Script that is ACCESSLEVEL and it will be set to either All or Limited.  If it is Limited it will provide the masking logic that you previously provided, but if it is all then I want all of the actual named DEPTs to be shown and not masked.  I added the following logic, but it did not work.

=PICK(MATCH(ACCESSLEVEL,

'All'  // When a user signs in with this as their ACCESSLEVEL I want the DEPT dimension to show w/o masking

  ,'Limited')  // This works as you defined

,DEPT

,aggr(if(len(only({<DEPT=, USERID=>}DEPT))> 0 ,

  if(only({<DEPT=, USERID=>}DEPT)=Only(DEPT) ,DEPT,

  'Dept' & FieldIndex('DEPT', only({<DEPT=, USERID=>}DEPT))))

, DEPT)

)

What am I missing?

Not applicable
Author

I have one additional use case that I need to be able to support.  I have added an additional column in my Edit Script that is ACCESSLEVEL and it will be set to either All or Limited.  If it is Limited it will provide the masking logic that you previously provided, but if it is all then I want all of the actual named DEPTs to be shown and not masked.  I added the following logic, but it did not work.

=PICK(MATCH(ACCESSLEVEL,

'All'  // When a user signs in with this as their ACCESSLEVEL I want the DEPT dimension to show w/o masking

  ,'Limited')  // This works as you defined

,DEPT

,aggr(if(len(only({<DEPT=, USERID=>}DEPT))> 0 ,

  if(only({<DEPT=, USERID=>}DEPT)=Only(DEPT) ,DEPT,

  'Dept' & FieldIndex('DEPT', only({<DEPT=, USERID=>}DEPT))))

, DEPT)

)

What am I missing?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try:

=PICK(MATCH(ACCESSLEVEL,

'All'  // When a user signs in with this as their ACCESSLEVEL I want the DEPT dimension to show w/o masking

  ,'Limited')  // This works as you defined

,aggr(only(DEPT), DEPT)

,aggr(if(len(only({<DEPT=, USERID=>}DEPT))> 0 ,

  if(only({<DEPT=, USERID=>}DEPT)=Only(DEPT) ,DEPT,

  'Dept' & FieldIndex('DEPT', only({<DEPT=, USERID=>}DEPT))))

, DEPT)

)

Not applicable
Author

I incorporated this change in the dimension, but is still not unmasking the names.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I suggest debugging the thing as an expression, testing it piece by piece. For example,

if(ACCESSLEVEL='All', 'Yes, 'no')

etc.

-Rob

Not applicable
Author

Thanks I will try that.

markagoodger
Contributor II
Contributor II

I just used your expression to achieve the same type of chart. Thank you Rob, very helpful.