Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mrbqlik2009
Contributor III
Contributor III

Filter Listbox By QVUSER()

Hi,

I have listbox with some value for example test1, test2, test3, test4, test5.

I want when user1 login to system, listbox show just value test1 and test2.

I write this:

=if(Upper(bLogin) = 'USER1',SaleTypeTitle={'test1', 'test2'})

but not work.

6 Replies
Anonymous
Not applicable

I would recommend using section access instead.

Create a USER as USER1 and the SaleTypeTitle to be the field used to filter, remember to create two lines for user 1.

See below example:

Access,  UserID,  SaleTypeTitle

USER,  USER1,  test1, 

USER,  USER1,  test2, 



mrbqlik2009
Contributor III
Contributor III
Author

Thank you.

but can i do that by write expression in listbox?

Anonymous
Not applicable

No this will require section access to be applied in the script.

tresesco
MVP
MVP

If you are looking to restrict the display in listbox (and not really data security is an issue), you may try like:

=if(Upper(bLogin) = 'USER1',

          If(Match(SaleTypeTitle,'test1', 'test2') ,SaleTypeTitle),

SaleTypeTitle)

YoussefBelloum
Champion
Champion

Hi,

try with the OSUSER() function

try first osuser() on a textbox, get the exact value and try this:

=if(OSUSER()= 'the value you got', if(match(SaleTypeTitle,'test1','test2',SaleTypeTitle))

mrbqlik2009
Contributor III
Contributor III
Author

Thanks. I use this expression but in listbox show test1, test2, test3, test4,test5.

I want just show test1 and test2.

i should say value of listbox fetch from database.