Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikmpate0
Contributor

match not working

Hi I'm trying to display a tab with selections for two users.


I have an on Open trigger on the document

=If(Match((Subfield(OSUser(),'\',2)='User1','User2' >0,'SH01','SH02'))) 


I want to add different selections for each user. Can I do this and have I got the syntax correct.


because when I open the document I can't see the correct sheet popping up on open.


Any help appreciated.


regards

M



Tags (1)
10 Replies
sasikanth
Valued Contributor III

Re: match not working

Hi,

Try this

pick(wildmatch(OsUser(),'*User1*','*User2*'),'SHO1',SHO2')

OR

pick(Match((Subfield(OSUser(),'\',2)='User1','User2'),'SH01','SH02')))

qlikmpate0
Contributor

Re: match not working

Sorry no doesn't work,

Re: match not working

if you are looking for sheet level access use below section access

Sheets Security with Section Access File

qlikmpate0
Contributor

Re: match not working

Thanks Manish,

I'm aware of section access but this is more to display a sheet 3 of 5 when opening a document.   , hence the usage of on open trigger.

regards

M

qlikmpate0
Contributor

Re: match not working

this works

=If(Subfield(OSUser(),'\',2)='User1',User2,'SH14','SH05')

can I put selections in here ie I want user1 to show group a and user2  to show group b

Re: match not working

What are groups here?

Not applicable

Re: match not working

hi Mina,

try with below expression:

=Mixmatch(osuser(),'DOMAIN\USER1','DOMAIN\USER2')>0

qlikmpate0
Contributor

Re: match not working

When I mention groups I'm saying that user one should only be able to see Northwest sales, and user2 only southwest sales. These would be my selections on the sheet.

Currently on the sheet I have a trigger so that when user1 is using the document only northwest sales are displayed, but I'm asking how can I add another trigger to say if user2 is logged on to show southwest sales?

hope this make sense.

Re: match not working

It does, but by doing if logic the user1 will be able to southwest sales if he clears out the selection? If that is something you don't want, then you might want to look into Section Access

Community Browser