Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
drjoffily
Partner Ambassador Alumni
Partner Ambassador Alumni

Section Access - Full access using Blank or *

Hi,

I'm using Section Access to control the level of access in my dashboard and I'm doing it reading from a table in Excel, since the Section Access tool imbedded in QEMC is very basic and couldn't control the level I need to implement.

I got to a point where I need to add every value in a field separated by commas and some of the fields I'm using to reduce my data have about 30 options.

Please see the example below where I reduce data based on the field SA REGION.

What I want to achieve is to be able to use '*' or ' ' or 'ALL' instead of having to list all the options like in the example below where I have to list all regions (USER | GLOBAL\B | Australia,Asia,Europe,Americas,New Zealand,Pacific)

ACCESSNTNAMESA REGION
ADMINGLOBAL\AAustralia,Asia,Europe,Americas,New Zealand,Pacific
USERGLOBAL\BAustralia,Asia,Europe,Americas,New Zealand,Pacific
USERGLOBAL\CAustralia
USERGLOBAL\DAsia,Americas
USERGLOBAL\EAustralia
USERGLOBAL\FAustralia,Asia,Europe,Americas,New Zealand,Pacific
USERGLOBAL\GAustralia,Asia,Europe,Americas,New Zealand,Pacific

This is how I'm using it in my scripts...

Section Access;

[SA TABLE]:
LOAD ACCESS,
     NTNAME,
SubField(REGION, ',')  as [SA REGION]
FROM
$(vSecurity)
$(vTabletype);

Section Application;

[Region]:
LOAD UPPER(NTNAME),
SubField(REGION, ',')  as [SA REGION]
FROM
$(vSecurity)
$(vTabletype_Region);

Does anyone have any idea how I can do it?

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I would define a variable for all regions and use that in Section Access, i.e. something along the lines of

AllRegions:

Load Concat(distinct Region, ',') as AllRegions From Regions ;

Let vAllRegions = peek('AllRegions',0,'AllRegions');

Drop Table AllRegions;

Section Access;

[SA TABLE]:

LOAD

          ACCESS,

          NTNAME,

          SubField('$(vAllRegions)', ',')  as [SA REGION]

FROM AuthorizationsTable;

HIC

View solution in original post

7 Replies
sushil353
Master II
Master II

Hi,

I have a sample query.. hope you will get some idea from that.

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD,%COUNTRY

    admin,admin,admin,*

    user,sushil,user,ASIA

    user,challa,user,US

   

];

Section Application;

LOAD * INLINE [

    country,%COUNTRY

    INDIA,ASIA

    US,US

    AFRICA,ASIA

];

tab1:

LOAD * Inline

[

country,customer,sales

INDIA,a,30

INDIA,b,30

INDIA,c,40

US,a,50

US,b,60

US,c,70

AFRICA,a,20

AFRICA,b,10

AFRICA,c,30

];

if your issue is not resolved then please update the sample data.

--sushil

drjoffily
Partner Ambassador Alumni
Partner Ambassador Alumni
Author

Thanks for your quick response Sushil.

The scripts and table I attached are just a portion of the script/table in my SA

I actually have multiple tabs in Excel to control multiple fields/Tabs so I couldn't move to a simple INLINE table. And I don't want to have to modify my scripts everytime I need to provide access to a new user. And the change management process in my company is really long. I prefer controling my SA via spreadsheet where I can change any time I want.

Is there any way to achieve it using Excel spreadsheets instead of INLINE tables?

sushil353
Master II
Master II

Hi,

yes it is possible... please post the sample aap for better understanding.

hic
Former Employee
Former Employee

I would define a variable for all regions and use that in Section Access, i.e. something along the lines of

AllRegions:

Load Concat(distinct Region, ',') as AllRegions From Regions ;

Let vAllRegions = peek('AllRegions',0,'AllRegions');

Drop Table AllRegions;

Section Access;

[SA TABLE]:

LOAD

          ACCESS,

          NTNAME,

          SubField('$(vAllRegions)', ',')  as [SA REGION]

FROM AuthorizationsTable;

HIC

sujeetsingh
Master III
Master III

henric sir you each reply give a basic way of doing complex thing .it resolved a issue for mee.

drjoffily
Partner Ambassador Alumni
Partner Ambassador Alumni
Author

Hi sushil,

Thanks again for your response.

I'm afraid the application contains sensitive information and it'd take too long to change it in a way I could post it to you.

Nevertheless, I think the info I provided above gives a good idea what I'm trying to achieve. I just want to replace the whole string by a '*' or a ' ' when someone has full access to that particular data and find a way for Qlikview to read the '*' and translate it as access to all regions. Please see example of what I want to have in my spreadsheet.

ACCESSNTNAMESA REGION
ADMINGLOBAL\A*
USERGLOBAL\B*
USERGLOBAL\CAustralia
USERGLOBAL\DAsia,Americas
USERGLOBAL\EAustralia
USERGLOBAL\F*
USERGLOBAL\G*

Thanks

drjoffily
Partner Ambassador Alumni
Partner Ambassador Alumni
Author

Thanks Henric,

You got me on the right track.

The only minor change I did in your solution to suit my needs was as below:

Section Access;

[SA TABLE]:

LOAD

          ACCESS,

          NTNAME,

          If(REGION = '*', SubField('$(vAllRegions)', ',') , SubField(REGION, ','))  as [SA REGION]

FROM AuthorizationsTable;

Thanks a lot