Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Partner
Partner

Show / Hide Sheet Tab based on Username Qlikview

Hello,

Hope all is well with everyone.

I am trying to show/hide sheet tab based on UserName.

I created a Matrix as follows

LOAD * INLINE

[

USERNAME_C,SHEETNAME,SHEETACCESS

Administrator,Docoument\ACTIVATION_CHURN,1

Administrator,Document\ACTIVE,1

Administrator,Document\MKT_DATA_TRAFFIC,1

Administrator,Document\MKT_REV_OVERALL_STAT,1

sales,Document\ACTIVATION_CHURN,0

sales,Document\ACTIVE,1

sales,Document\MKT_DATA_TRAFFIC,0

sales,Document\MKT_REV_OVERALL_STAT,0

syed,Document\ACTIVATION_CHURN,0

syed,Document\ACTIVE,0

syed,Document\MKT_DATA_TRAFFIC,1

syed,Document\MKT_REV_OVERALL_STAT,0

];

Then I use the following set analysis in the Sheet Properties Conditional Statement. 

=if(max({<USERNAME_C = {'$(=subfield(OSUSER(),'\',2))'},SHEETNAME = {'$(=getActiveSheetId())'}>}SHEETACCESS)='1',1,0)

The statement works fine when i put it in textbox and it gives me 1 or 0.

But when i enter it in the sheet condition it behaves very strangely.  The Tabs which are have 0 value are someimes appearing sometimes not - even sometimes when they are appearing i am not able to click on them.  Some times all the tabs disappear and only couple of tabs are shown.

Will appreciate is someone can assist with this.

Thanks.

1 Reply
vardhancse
Valued Contributor III

Re: Show / Hide Sheet Tab based on Username Qlikview

Section Access;

LOAD ACCESS,

     NTNAME,

     SAREP,

     NM

FROM

'..\..\..\Dashboard\SectionAccess.xlsx'

(ooxml, embedded labels, table is SA);

Then you add the sheet access coding directly underneath

Section Application;

Sheet_Security:

LOAD USERS as NM,

     SH01,

     SH02,

     SH03,

     SH04,

     SH05,

     SH06,

     SH07,

     SH08

FROM

'..\..\..\Dashboard\SectionAccess.xlsx'

(ooxml, embedded labels, table is SHEETS);

My Section Access table looks like you would expect and the NM column is to specify their role, MGR or NON for different sheet access, i.e.

NTNAME   SAREP   NM

him            Richard   NON

her             Mike       NON

mgr1           *            MGR

mgr2           *            MGR

and the Sheets Table looked like so:

USERS  SH01  SH02  SH03.... SH07 SH08

NON         1         1         1           0        0

MGR         1         1         1           1        1

Then set the condition property for each respective sheet to show if the flag for that sheet is 1, i.e.:

SH08=1

Then reload!