Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Execute different scripts per User

Hello QlikView Community,

I have encountered a problem. I would like to let different Users load different scripts in one .qvw file. Meaning the scripts are somehow written safed in the file but only sepcific parts are executed depending on the User. The rest will be ignored.

Is that possible

Thanks and regards

Milliohm

Tags (3)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Execute different scripts per User

You can conditionally execute script by using the the IF THEN ELSE statement. In the IF test, you can test the userid as osuser().

-Rob

5 Replies
MVP & Luminary
MVP & Luminary

Re: Execute different scripts per User

You can conditionally execute script by using the the IF THEN ELSE statement. In the IF test, you can test the userid as osuser().

-Rob

Not applicable

Re: Execute different scripts per User

Hello Rob,

thanks for your quick answer. Ihave tried to apply the IF..THEN Statement but could not figure it out. I have set it as following.

IF(USERID= 'RespectiveUser') then

     LOAD Statement

I tried several punctuations and sets of brackets but it just does not work Smiley Frustrated

Regards

fkeuroglian
Honored Contributor

Re: Execute different scripts per User

Hi, you have to use first in the script OSUSER() to identify the user, then as Rob say you have to use IF, ELSE THEN sentences to load the script, pherhaps you forgive a final End if; to exit to the IF statement..

good luck

Fernando

MVP & Luminary
MVP & Luminary

Re: Execute different scripts per User

The function that identifies the user is osuser(), not USERID. So a sample script would be

IF(osuser() = 'RespectiveUser') THEN

     LOAD Statement

ENDIF

-Rob

Not applicable

Re: Execute different scripts per User

Hi guys,

thanks a lot for your help! It works now. And sorry Rob but somehow I did not notice the OSUser()

Again thnaks and have a good day

Regards