Tiered Security with Section Access
One of the really clever features of Qlik’s data apps is the ability to have tiers of security. If you are familiar with Section Access then you may have either wondered or worked out how to simplify security with a tiered model.
This is just one way of doing it. The example is from Qlik Sense and will work in QlikView too.
/* Tiered security (section access) sample */ // Bring in the Manager details [Manager]: Load Upper ( [Manager] ) As [MANAGER], Upper ( [Area Manager] ) As [MANAGER PARENT] From [lib://Data Files/security sample.xlsx] (ooxml, embedded labels, table is [security]); // Use mapping table to create 'ALL' type consolidation as this is more reliable than the wildcard (*) option Concatenate ( [Manager] ) Load [MANAGER], 'ALL' as [MANAGER PARENT] Resident [Manager]; // Now build security table // Start security section Section Access; // Create in line table of security details (should really come from externally managed source) Load * Inline [ ACCESS, USERID, MANAGER PARENT ADMIN, QLIK.ADMIN, ADMIN, INTERNAL\SA_SCHEDULER, USER, QLIK\USER1, ALL USER, QLIK\HOMER, HOMER SIMPSON USER, QLIK\BART, BART SIMPSON ]; // Continue with rest of application (remembering to link to security field(s)) Section Application;