Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set two or more default selections in one field for a user

hi all,

I want to ask  a question. I want to set  two default selections in one filter for a specific user. so i went to

documet --> on open<has action> -->add-->selection-->select in field and wrote in value:

=IF(OsUser()='user1','selection1' | 'selection2')

but the code is wrong

Does enybady know the corrent code for this?

1 Solution

Accepted Solutions
sasikanth
Master
Master

HI ,

Try something like this

IF(OsUser()='user1',  '('&'"Selection1"'&'|'&'"Selection2"'&')' )

View solution in original post

9 Replies
Anonymous
Not applicable
Author

the Syntax for several values

(value1|value2)

in your case should be like

=IF(OsUser()='user1',('selection1' | 'selection2'))

I didnot get it work when I use if only with direct Definition

maybe in combination with if there must be another Syntax??

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi mate,

Why don't you use bookmarks? It seems a better solution for you

Hope it helps,

Regards,

MB

Not applicable
Author

Thank you guys

I think the only way is to use bookmarks

sasikanth
Master
Master

HI ,

Try something like this

IF(OsUser()='user1',  '('&'"Selection1"'&'|'&'"Selection2"'&')' )

Not applicable
Author

thank you! you solved my problem!

Not applicable
Author

Hi,

Are there multiple users for which you require multiple selections? Afore mentioned solutions will be working fine for only 1 user.

jagan
Partner - Champion III
Partner - Champion III

Hi,

If values are static then you can directly give

=IF(OsUser()='user1','(selection1|selection2)')


Regards,

Jagan.

Not applicable
Author

There is no problem in multiple users if you use 'or' statement.

For example:

=IF(OsUser()='user1' OR OsUser()='user2' ,'('&'"Selection1"'&'|'&'"Selection2"'&')' )

jagan
Partner - Champion III
Partner - Champion III

Hi,

For multiple users try like this

=IF(OsUser()='user1' OR OsUser()='user2' ,'(selection1|selection2)')


OR with Mixmatch() like below


=IF(MixMatch(OsUser(), 'user1', 'user2', 'user3', 'user4') ,'(selection1|selection2)')