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

Conditional show/hide based on field level security

Hello Experts,

I have a following situation:

I have a field Salary and say i have three users- user1, user2 and user3. Only user1 has privilege to see the Salary field. When user2 and user3 login they see the below

I implemented this via the section access using the OMIT field in the script, but now my requirement is to hide this field completely from the user2 and user3 instead of showing it as (unavailable)[Salary]. They shouldn't know a field exists in the application. Can we achieve this in QV.

Thanks in advance!!

Regards,

Roopak

9 Replies
Not applicable
Author

Hi Roopak,

you can use conditional display, but it is not the best secured way to hide data

either with 2 graphs according user, or play with text and background...

best regards

chris

Gysbert_Wassenaar

You can use the QVUser() function to get the name of the current user as entered in section access. You can use that in an if statement for the conditional display function. Something like =if(match(QVUser(), 'user1', 'userY', 'userX'),1,0). But you should also restrict users access to sheet object properties using the Security sheet and document settings.


talk is cheap, supply exceeds demand
datanibbler
Champion
Champion

Hi Roopak,

sure you can. I don't know which type of chart you have this in - I have this kind of fields (with sensitive information) in straight-table charts that I use for detail data.

=> In that case, you can, on the "presentation" tab of the properties dialog, enter a visibility_condition for that column.

ashfaq_haseeb
Champion III
Champion III

Not applicable
Author

Thanks all for your responses.

Ashfaq , i have already that blog, very helpful indeed, but it doesnt answer my question.

DataNibbler , i am not using any chart in this example, just a few list boxes . Attaching the example here. ( use the below user/passwd cominbation : user1/user1, user2/user2, user3/user3 )

Gysbert, a very useful workaround but what if i have many users.

Christian, Conditional display seems to be the only option but is there anyway we can make use of the label like (unavailable) in the condition.

Any help would be highly appreciated.

Regards,

Roopak

Not applicable
Author

Hi Roopak - did you try the omit option in your section access?

Not applicable
Author

Yes, OMIT will render the field as unavailable[fieldname] , but at the same time visible to the user. What i need is that when the field becomes unavailable, it should be invisible to the users. I am guessing something should be put in the Properties->Layout->Show->Conditional, but stuck as to what condition to put.

Not applicable
Author

Roopak,

if you want to use conditional display you can switch between 2 graphs and 1 variable

LET vShow = 1

Graph 1 condtional display is vShow = 1  will display graph 1 with salary

Graph 2 condtional display is vShow = 0  will display graph 2 without salary

set the variable thru trigger on "open the document" according to user profile  QVuser() or so

best regards

Chris

Not applicable
Author

You will have to use show and hide for the Omitted field in the UI. eg: qvuser()='ADMIN'