Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide some sheets in the Application used on the Server.

Hi All,

My Client asked me to hide some sheets of QV application available on Server (Accesspoint) based on the USER having ADMIN rights.

I have used Conditional SHOW sheet check-box with following logic --------

I have created 2 vairables named as "Admin" and "Var"

means for these sheets I have given SHOW SHEET condition as =(Admin)>0

Where "Admin" is a variable with definition

--------- =(fieldindex('ca_user',Var))

And "Var" is a variable with definition ----------- =subfield(osuser(),'',2)

As you know, OSUSER() shows DOMAIN\USER-ID.

ca_user is a field(column) showing USER-ID with administration rights from a table created by Client.

It works fine on local machine but it doesn't work on Server like Accesspoint.

Insted of FIELDINDEX,i have used EXISTS but this function also works only on local machine not on the Server.

Could you please tell me how to hide sheets in the application available on the Server.

1 Solution

Accepted Solutions
Not applicable
Author

Hi, Ajay, I received your inquiry through internal server support. They should be getting back to you shortly with this possibility, but I wanted to post it here too for the public. Please try the wildmatch function for something like this in your conditional show function:

=sum(if(wildmatch(<user id field>,Upper(ltrim(rtrim(subfield(osuser(),'\',2))))),1,0))

This seemed to work on the server (v. 8.2) as well as through Developer. Good luck!

View solution in original post

8 Replies
Not applicable
Author

Hi,

In your section access part, in the table where there is the ACCESS field, create a new column FLAG_ADMIN which is created automatically from the ACCESS column :

if(ACCESS='ADMIN', 1 , 0) as FLAG_ADMIN

in the section Application add this little table (no need to link it to any other table) :

LOAD * INLINE [
FLAG_ADMIN
1
0
];

do not forget to activate to data reduction : check the check box (settings/document properties / tab : Opening / initial data reductionbased on section access)

Then in your document, use FLAG_ADMIN to test if your user is an admin ( or use max(FLAG_ADMIN) if some users are both ADMIN and USER).

P.S : I've made an enhancement request for having a native function to test if actual user is ADMIN or not. QlikTech have taken it into account (ID 754) but I don't know when they will add it.

Hope it helps

Best regards

Not applicable
Author

Sorry Bertrand for late reply.

I am still trying to resolve it.

I have to compare USERID of OSUSER() with the USERID available in the SQL SERVER table for Conditional SHOW.

Please tell me, Is there any FUNCTION in QlikView to compare one field-values(Column) with one hardcoded value.

FIELDINDEX and EXISTS can be used to compare this but it works only on the local machine NOT on the Server.

So,Please let me know the function of Comparison which works for the Server based Apllication.

Thanks and Regards

Ajay

Not applicable
Author

Hi, Ajay, I received your inquiry through internal server support. They should be getting back to you shortly with this possibility, but I wanted to post it here too for the public. Please try the wildmatch function for something like this in your conditional show function:

=sum(if(wildmatch(<user id field>,Upper(ltrim(rtrim(subfield(osuser(),'\',2))))),1,0))

This seemed to work on the server (v. 8.2) as well as through Developer. Good luck!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Ajay,

How about this (I haven't tried on server, but I believe it will work).

Define a variable "vAdmin" with value:
=concat(chr(39) & ca_user & chr(39),',')

Note the "=" is part of the variable value.

Define another variable "IsAdmin" with the value:
mixmatch(subfield(OsUser(),'\',2), $(vAdmin))

For your sheet conditional expression, use:
=$(IsAdmin)

You could use the "=mixmatch(subfield(OsUser(),'\',2), $(vAdmin))" expression in your show condition, but making another variable makes it bit easier to on multiple sheets.

Let me know if it works. An example is attached. Add your userid into the script to test and reload, then you should see the "Admin only sheet".

-Rob

Not applicable
Author

Thank you very much Jennifer for your great help.

Your solution is working fine.

Thanks once again for spending your precious time for my issue.

Best Regards

Ajay

Not applicable
Author

Thank you very much Rob for your great help.

Your solution is working fine.

Thanks once again for spending your precious time for my issue.

Best Regards

Ajay

Not applicable
Author

Thank you very much Bertrand for your help.

I am sure your recommended solution will work.............. but my client asked to avoid Section-access.

So i have tried to use any function for comparison instead of Fieldindex/Exist..............Now Wilmatch/Mixmatch as shown in below post, is working fine.

Thanks once again!

Best Regards

Ajay

Not applicable
Author

This worked like a charm!