Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Trigger a set variable based on USERID

Namaste all

I have successfully implemented section access on my file and uploaded it on the server with the help of you guys..

Please help me with the following trigger settings..

I have implemented section access in my file,

But, I am unable to Trigger a variable based on USERID,

I will explain my scenario.

I have three sheets in my document L1, L2, L3   and i have users user1, user2, user3 and the variable i want to trigger is LineNo.

I want variable LineNo to set to 1 when i open as user1, LineNo=2 when i login as user2 , LineN=3 when i login as user3.

please find the attached qvw file and excel file to check my code and trigger settings..

Please see my if condition, at the trigger->document properties->onopen->set variable

Admin credentials:

Username : Rahul

PAssword : Rahul101

section access is not hidden

Thank you in advance

36 Replies
Not applicable
Author

Thank you and gr8 sir, it is working fine when i login user

but have you seen , when i login as admin, the first sheet is not showing the correct LineNo

please see by login as Admin and you will see the different current line for the first sheet that you open,

than when you click on other sheet it will get the correct current line, because it uses the sheet level trigger

I think , i explained you my problem clearly.. please ask me if you don't understand

Thank you

sunny_talwar

As Rahul

Capture.PNG

As User1

Capture.PNG

kkkumar82
Specialist III
Specialist III

I think the conditions are written only for USER1, USER2 and USER3

sunny_talwar

But there is a false statement which defaults to 0. I think it is working at my end as I would expect

=if(USERID='USER1',1,

if(USERID='USER2',2,

if(USERID='USER3',3,0)))

Not applicable
Author

Hi sunny

I am seeing the current line as 0, because i think, we dont have any logic for trigger when we login as admin, could you please fix this, than i am done

Capture.PNG

Not applicable
Author

yeah, exactly, could you fix,

what should be done to get the correct line no when we login as admin

Thanks

Not applicable
Author

yeah, exactly.. what should be done for admin, to show up the correct line no when we login as admin

Thanks

sunny_talwar

This?

=if(USERID='USER1',1,

if(USERID='USER2',2,

if(USERID='USER3',3,

If(USERID = 'RAHUL', 4))))

sunny_talwar

Check now, Rahul will have LineNo 4

Not applicable
Author

but, i wont get any values for that , sheet, if the line no is 4, in fact there is no line no 4, in my database,,

it will  be a big problem again

is there any way to get the current line no as

correspoding to that sheet

means,

when i login as admin, if the first sheet that, i see is L1, than the current line no should be 1

I hope you got  me

Thanks