Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have my security table like below
ACCESS | NTNAME | USER_GROUP |
USER | ABC | SUPERGROUP |
USER | XYZ | NON_INT_GROUP |
USER | PQR | INT_GROUP |
and code
Section Access;
load
ACCESS, NTNAME, USER_GROUP
from .... .qvd;
Section Application;
i would like to reduce data in two levels, country and dept
so i have the country and dept table which linked with above table, assume like below;
USER_GROUP | COUNTRY | DEPT |
XXXXXX | Canada | INT |
XXXXXX | Canada | NON_INT |
XXXXXX | MEXICO | Other |
My question is,
1. when user login as PQR, he should see, all canada details including INT and NON_INT dept
2. when user login as XYZ, he should see, Canada details, but only related to NON_INT dept
I made a key, using (COUNTRY &'##' & DEPT ) as KEY and integrated with section access, but it does not work the way i want,
is there any suggestion or some simple technique to get it done..
thanks in advance
Ren
The simplest way is the following:
UserGroup:
LOAD USERGROUP,
UPPER(COUNTRY & '#' & If(Len(Trim(DEPT))=0,'<ALL>',DEPT)) as KEY
FROM HierarchyInSectionAccess.xlsx (ooxml, embedded labels, table is UserGroup);
BridgeTable:
LOAD COUNTRY,
DEPT,
Upper(COUNTRY & '#' & '<ALL>') as KEY
FROM HierarchyInSectionAccess.xlsx (ooxml, embedded labels, table is Dimension);
LOAD COUNTRY,
DEPT,
UPPER(COUNTRY & '#' & DEPT) as KEY
FROM HierarchyInSectionAccess.xlsx (ooxml, embedded labels, table is Dimension);
You probably need to have the UserGroup table inside Section Access, and if you need additional tables for country and dept, you should link those to the BridgeTable
HIC
you script should look like:
section access;
load * inline
[UserID, USERGROUP,user
ABC, SUPERGROUP, User
XYZ, NONINTGROUP, User
PQR, INTGROUP,User ] ;
section application;
star is *;
load * inline
[USERGROUP, COUNTRY, DEPT
SUPERGROUP, Canada, *
NONINTGROUP, Canada, NON_INT] ;
The star (in DEPT) will unfortunately not do what you want. You need a solution where you use Generic Keys to map your authorization.
See more on
HIC
Hi Henric, would like to open the link you pasted here, but i am unable to open it.
You're right. Here they come again:
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/02/complex-authorization
Thanks for the reply Henric,
I have read the doc,
But my Authorization Table has null values like below
The Dept column has null, which means, SUPERGROUP can view all the department under respective contries.
USER | USER_GROUP | COUNTRY | Dept |
U1 | SUPERGROUP | AE | |
U2 | SUPERGROUP | BH | |
U3 | SUPERGROUP | EG | |
U4 | SUPERGROUP | IR | |
U5 | SUPERGROUP | JO | |
U6 | SUPERGROUP | KW | |
U7 | SUPERGROUP | LB | |
U8 | SUPERGROUP | OM | |
U9 | SUPERGROUP | PK | |
U10 | SUPERGROUP | QA |
I think you should create a generic key like
Upper(Country) & '|' & if(Len(Trim(Dept))=0,'<ANY>',Upper(Dept)) as %COUNTRYDEPT
Then you can use an authorization bridge table to map the values of %COUNTRYDEPT to respective COUNTRY and Dept, e.g.
HIC
Is this based on Hierarchy? What is the relationship between Country & Dept? which field sits at the most granular level? As suggested by HIC, Generic Keys with Authorization table is very powerful approach to solve this kind of requirements.
Thanks,
DV
Hi Henric sorry for the late response,
Here is my situation,
My usergroup table has
USERGROUP | COUNTRY | DEPT | KEY |
SUPERGROUP | UA | UA## | |
SUPERGROUP | BH | BH## | |
SUPERGROUP | SA | SA## | |
GROUP2 | UA | INT | UA##INT |
Then comes my dimension table which has
COUNTRY | DEPT | KEY |
UA | INT | UA##INT |
UA | HO | UA##HO |
BH | INT | BH##INT |
. | . | . |
. | . | . |
when i tried connnecting using KEY, it maps only the GROUP2-UA-INT-UA##INT
Others it doest not show coz it does not know which row to match with, i am confused with the bridge table.
Thanks in advance..