Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

Re: OSUser(): Visible data restricted through user

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

View solution in original post

7 Replies
Highlighted
Master II
Master II

Re: OSUser(): Visible data restricted through user

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.

Highlighted

Re: OSUser(): Visible data restricted through user

I tried with this expression:

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

Highlighted
Master II
Master II

Re: OSUser(): Visible data restricted through user

It just shows current user data and admins data.

Highlighted
Partner
Partner

Re: OSUser(): Visible data restricted through user

Use a different expression for user or admin like this:

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

Sum(Target),

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

)

Highlighted
Partner
Partner

Re: OSUser(): Visible data restricted through user

I tried the same:

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

     sum(Target),

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

)

but it delivers just the user.

Highlighted
Partner
Partner

Re: OSUser(): Visible data restricted through user

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

Highlighted
Partner
Partner

Re: OSUser(): Visible data restricted through user

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

View solution in original post