Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
mrbqlik2009
Contributor III
Contributor III

Hide one item of listbox for specific user

Hi,

I have listbox with 3 item 'test1', 'test2', 'test3'..

i have 2 user in section access 'user1', 'user2'.

I want when user 1 login to system see all listbox item, but when user2 login, just see 'test1' and 'test2'.

1 Solution

Accepted Solutions
sunny_talwar

In that case, you can try this

If(OSUser() = 'User2', Aggr(Only({1<item = -{'test3'}>} item), item), item)

View solution in original post

6 Replies
sunny_talwar

May be like this

If(OSUser() = 'User2', Aggr(Only({<item = {'test1', 'test2'}>} item), item), item)

mrbqlik2009
Contributor III
Contributor III
Author

Thank you. it work.

but another question. suppose we have 20 item in listbox and  we want just one item hide in listbox.

we should write 19 item in expression?

sunny_talwar

In that case, you can try this

If(OSUser() = 'User2', Aggr(Only({1<item = -{'test3'}>} item), item), item)

mrbqlik2009
Contributor III
Contributor III
Author

this expression If(OSUser() = 'User2', Aggr(Only({1<item = -{'test3'}>} item), item), item) give error.

because that -{'test3'}.

I think "-" before {} is incorrect syntax.

sunny_talwar

Ignore the syntax error shown by the expression editor and click ok to see if it works or not... expression editor can be misleading at times

mrbqlik2009
Contributor III
Contributor III
Author

That's work.

Thank you.