Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
PhilippZiemer
Partner
Partner

OSUser(): Visible data restricted through user

Hello community,

I want to restrict the data visible, not just remove the values or distribute the data already restricted for users through publisher or nprinting.

Each user has a target. There is a target for every year:

The users have restircted rights depending on their OSUser() (I am Tom in this case):

I can only see my data currently:

Since I am admin, I want to see the data of everybody. I am not able to achieve this. I tried mainly set analysis.

sum(if(only( {$ < OSUser = {'$(=OSUser())'}> } Admin_Flag ) = 'true', Target))


You can find every a prepared example in the attachment. Thansk for any help. I am open to different approaches.


Best

Philipp

1 Solution

Accepted Solutions
PhilippZiemer
Partner
Partner
Author

So I managed to get the result through conditional Expressions. Thanks everyone!

View solution in original post

7 Replies
whiteline
Master II
Master II

Hi.

Why don't you use section access  ?

Anyway I think it's better to add 'Role' entity and then connect the users with the roles. So you get more flexibility and can use the same expressions for both admins and users.

Usually it's better to use set analysis for that like this: Sum({<OSUser={'$(=OSUser())'}>} Target)

You also have to restrict server objects creation, otherwise the users can simply change the expression.

alexandros17

I tried with this expression:

sum(if(OSUser = OSUser() or Admin_Flag = 'true', Target))

whiteline
Master II
Master II

It just shows current user data and admins data.

stigchel
Partner
Partner

Use a different expression for user or admin like this:

if(Concat({<OSUser={'$(=OSUser())'}>} Admin_Flag) = 'true',

Sum(Target),

Sum({<OSUser={'$(=OSUser())'}>} Target)

)

PhilippZiemer
Partner
Partner
Author

I tried the same:

if(match(minstring({<OSUser={'$(=OSUser())'}>} Admin_Flag), 'true'),

     sum(Target),

     sum({<OSUser={'$(=OSUser())'}>} Target)

)

but it delivers just the user.

PhilippZiemer
Partner
Partner
Author

It is unwanted here because it is just one simple value in the hole application.

PhilippZiemer
Partner
Partner
Author

So I managed to get the result through conditional Expressions. Thanks everyone!

View solution in original post