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: 
Alex78
Contributor III
Contributor III

How to move Text Boxes Dynamically in Qlikview

Hi all, 

I have a QV application that have several text boxes with triggers to activate (or go to) another sheet when selected. The tabs are going to replace the function of the application Sheet Tabs, i.e., tabrows will be hidden from document properties.

Based on users access, the Sheets  as well these Text Box based tabs will be active or hidden; and aligned left. Look at the three images for three different users accessing the document. Img 1: General Tabs layoutImg 1: General Tabs layoutImg 2 User A Tabs layoutImg 2 User A Tabs layoutImg 3: User B Tabs layoutImg 3: User B Tabs layout

 

 

 

 

 

 

 

 

 

 

 

 

based on the images above, User A will see Tabs 1,3 and 4. Tab 2 as well Sheet 2 will be hidden from User A. Tab 3 and Tab 4 will be aligned left. The same with User B.  

 

Thank you in advance

Alex

  

 

 

 

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try this qvw file. 

Laborate and reload the load script filter "Access" for different user scenarios. 

LOAD * Inline [
Sheet, Header, Access
SH01, Main sheet,1
SH02, Sheet no1, 1
SH03, Sheet no2, 0
SH04, Sheet no3, 1
]
WHere Access = 1
;

View solution in original post

11 Replies
Vegar
MVP
MVP

You might be able to create and align your textboxes with some of the macro functionality found in QlikView, someone other than me should guide you if it is possible. 

An alternative to re-aligning textboxes based on access is to dynamicly generate the header and activation of a text box. 

User A

Box1 = 'Tab1'; Box2 = 'Tab3';Box3='Tab4'; Box4=<hidden>

User B

Box1='Tab2';Box2='Tab4';Box3=<hidden>;Box4=<hidden>

 

With this solution the textboxes wont need to move around, but you do still get the same look and functionality for the end user.  Its probably a bit of fiddeling to do it, but it should be totally doable.

Alex78
Contributor III
Contributor III
Author

Thank you Vegar,
Can you elaborate the logic you indicated or give me an example?

Thank you
Vegar
MVP
MVP

Try this qvw file. 

Laborate and reload the load script filter "Access" for different user scenarios. 

LOAD * Inline [
Sheet, Header, Access
SH01, Main sheet,1
SH02, Sheet no1, 1
SH03, Sheet no2, 0
SH04, Sheet no3, 1
]
WHere Access = 1
;
Vegar
MVP
MVP

@Alex78 You could of course apply this logic to the sheets its self if you would like to avoid the extra textboxes
Alex78
Contributor III
Contributor III
Author

Thank you Vegar.
It is working.

Thank you!!
Alex78
Contributor III
Contributor III
Author

Hi @Vegar, all the test went well and worked great. But when I deploy it to QMC and reload, noting is returned for every FirstField() function.
Any idea?

Thank you
Vegar
MVP
MVP

Are you reducing the available field values with section access? If so, make sure that you do have available field values in the published version.
Alex78
Contributor III
Contributor III
Author

Thank you for coming back on this @Vegar,

Yes, I am using section access to reduce data.

What I do on my document is when I use OSUser() function to filter the user Sheet access in the script, it returns as intended on QV Desktop with the Text Box Tabs required to be hidden/visible as planned. Once deployed, it returns nothing or all the Text Box Tabs are hidden for the user. However, if I hard code the user in the script filter, it works as intended both on desktop and after deployed to server.

Based on your sample qvw, I added the User Login on the load as follows.

LOAD * Inline [
Sheet, Header, Access, UserLogin
SH01, Main sheet,1, Domain\User01
SH02, Sheet no1, 1, Domain\User01
SH03, Sheet no2, 0, Domain\User01
SH04, Sheet no3, 1, Domain\User01

SH01, Main sheet,0, Domain\User002
SH02, Sheet no1, 1, Domain\User002
SH03, Sheet no2, 1, Domain\User002
SH04, Sheet no3, 0, Domain\User002
]
Where Access = 1
AND UserLogin = 'Domain\User002';

==> this returns SH02 and SH03 Tabs active and aligned left, with the header and sheet triggers set as intended.

But with the following it does not work

 

LOAD * Inline [
Sheet, Header, Access, UserLogin

...... same as above

]

Where Access = 1
AND UserLogin = OSUser();

==> Hides all the Text Box Tabs. I tested the values of the field with text boxes and returns nothing both for the header and sheet. 

I also tested the application on desktop and server with and without section access and is behaving same.

Thank you for the help.

 

Vegar
MVP
MVP

 

 

 

WHERE UserLogin = OSUser()

If you use OSUser() in the script you only get the OSUser for the user executing the script, not dynamicly for each user using the application. When running in QMC the OSUser() will we your service account.

 

 

You need to use Section Access or Reduce data the distribution if you have a QlikView Publisher.

See attached qwv with an simple SA implementation.

 

USERID, PASSWORD, SHEETACCESS
ADMIN, 123, 	  *
USER1, 123, 	  SH01|SH03  
USER2, 123, 	  SH01|SH02
USER3, 123, 	  SH03
USER4, 123, 	  SH01|SH02|SH03|SH04