Advertisements

Learning some #Qlikview Section Access

I got sort of stumped on a recent interview by a question about section access. I had read about the concept but hadn’t ever sat down and played with it. Time to rectify!

First things first, edit the script and Hit Control Q Q, yay magic data.

Goto file and then create hidden script, set a password

Goto Insert, section access, Inline, and then Basic User Access

Let’s keep it simple to start. Apparently section access likes everything in uppercase 🙂

ACCESS USERID PASSWORD

ADMIN ADMIN ADMIN123

USER DIM1 DIM1

USER DIM2 DIM2

USER DIM3 DIM3

Reload it and save, now when you close it and come back in it should prompt you for a password.


Ok, lets make it a little more elaborate.

So let’s use section access to limit who can see Dim1, Dim2, and Dim3

This is a crude way of accomplishing it, add an OMIT header and then Cartesian out the fields that they shouldn’t see

Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, OMIT
ADMIN, ADMIN, ADMIN123
USER, DIM1, DIM1, DIM2
USER, DIM1, DIM1, DIM3
USER, DIM2, DIM2, DIM1
USER, DIM2, DIM2, DIM3
USER, DIM3, DIM3, DIM1
USER, DIM3, DIM3, DIM2
];
Section Application;

A little more elegant approach is


Section Access;

LOAD * INLINE [
ACCESS, USERID, PASSWORD, OMITGROUP
ADMIN, ADMIN, ADMIN123
USER, DIM1, DIM1, DIM1
USER, DIM2, DIM2, DIM2
USER, DIM3, DIM3, DIM1
];

LOAD * INLINE [
OMITGROUP, OMIT
DIM1,DIM2
DIM1,DIM3
DIM2,DIM1
DIM2,DIM3
DIM3,DIM1
DIM3,DIM2
];

Section Application;


Next time I’ll dive even a little deeper

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: