Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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

View solution in original post

5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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
Author

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 :S

Regards

fkeuroglian
Partner - Master
Partner - Master

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

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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
Author

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