Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
salto
Valued Contributor II

Section access - wildcard in multiple reduction fields

Hello,

I need to set up user access, so

  • users 1 to 6 should see their records in all countries
  • qlikuser should see Viggo's records only in Sweden
  • Qlikuser should see all records in Finland and Norway

Section Access;

LOAD * INLINE [

ACCESS,        NTNAME,        SALESPERSON,        COUNTRY

ADMIN,        ADMINISTRATOR,    *,            *

USER,        USER1,        VIGGO,            *

USER,        USER2,        JOHAN,            *

USER,        USER3,        ANNIE,            *

USER,        USER4,        HAKAN,            *

USER,        USER5,        PIOTR,            *

USER,        USER6,        HELEN,            *

USER,        QLIKUSER,    VIGGO,            SWEDEN       

USER,        QLIKUSER,    *,            FINLAND

USER,        QLIKUSER,    *,            NORWAY

];

The result is that QLIKUSER can see all records in Finland and Norway... and Sweden!!! He should seet only Viggo's records in Sweden but he sees all records for the rest of users.

Is the desired  data reduction possible in Qlikview?

Many thanks in advance!

Josetxo

1 Solution

Accepted Solutions
salto
Valued Contributor II

Re: Section access - wildcard in multiple reduction fields

Well, with some help from our partner we have what we wanted. Hidden script:

Section Access;

[SECURITY]:

LOAD

     NTNAME,      

     ACCESS,

     REDUCTION1,

     REDUCTION2  

FROM Reductions.xls (biff, embedded labels, table is Security$);

Section Application;

STAR IS *;

Access:

LOAD

  REDUCTION1,

  SalesPerson

FROM IReductions.xls (biff, embedded labels, table is Reduction1$);

Access2:

LOAD

  REDUCTION2,

  Country

FROM Reductions.xls (biff, embedded labels, table is Reduction2$);

The Reductions.xls file looks like this:

Security sheet:

NTNAME ACCESSREDUCTION1REDUCTION2
ADMINISTRATORADMINALLALL
USER1ADMINVIGGOALL
USER2USERJOHANALL
USER3ADMINANNIEALL
USER4USERHAKANALL
USER5USERPIOTRALL
USER6USERHELENALL
QLIKUSERUSERVIGGOALL
QLIKUSERUSERALLSWEDEN
QLIKUSERUSERALLFINLAND
QLIKUSERUSERALL

NORWAY

Reduction1 sheet:

REDUCTION1SalesPerson
ALL*
VIGGOViggo Mortensen
JOHANJohan Muller
ANNIEAnnie Hall
HAKANHakan Mild
PIOTRPiotr Volkov
HELENHelen Lindt

Reduction2 sheet:

REDUCTION2Country
ALL*
SWEDENSweden
FINLANDFinland
NORWAYNorway

Thanks to you all who helped me!

3 Replies
Not applicable

Re: Section access - wildcard in multiple reduction fields

Hi Josetxo,

You could try loading it from an excel file. Put the details in an excel file then load it like this.

SECTION Access;

Directory;

LOAD

     ACCESS,

     NTNAME,

     PASSWORD,

     upper(SALESPERSON) as SALESPERSON,

     upper(COUNTRY) as COUNTRY

FROM

access.xlsx

(ooxml, embedded labels, table is Sheet1);

Regards,

Janzen

MVP
MVP

Re: Section access - wildcard in multiple reduction fields

HI,

Can you attach your script in data model which has Salesperson and Country fields?  Your datamodel should have this fields then it will automatically restricts.

Regards,

Jagan.

salto
Valued Contributor II

Re: Section access - wildcard in multiple reduction fields

Well, with some help from our partner we have what we wanted. Hidden script:

Section Access;

[SECURITY]:

LOAD

     NTNAME,      

     ACCESS,

     REDUCTION1,

     REDUCTION2  

FROM Reductions.xls (biff, embedded labels, table is Security$);

Section Application;

STAR IS *;

Access:

LOAD

  REDUCTION1,

  SalesPerson

FROM IReductions.xls (biff, embedded labels, table is Reduction1$);

Access2:

LOAD

  REDUCTION2,

  Country

FROM Reductions.xls (biff, embedded labels, table is Reduction2$);

The Reductions.xls file looks like this:

Security sheet:

NTNAME ACCESSREDUCTION1REDUCTION2
ADMINISTRATORADMINALLALL
USER1ADMINVIGGOALL
USER2USERJOHANALL
USER3ADMINANNIEALL
USER4USERHAKANALL
USER5USERPIOTRALL
USER6USERHELENALL
QLIKUSERUSERVIGGOALL
QLIKUSERUSERALLSWEDEN
QLIKUSERUSERALLFINLAND
QLIKUSERUSERALL

NORWAY

Reduction1 sheet:

REDUCTION1SalesPerson
ALL*
VIGGOViggo Mortensen
JOHANJohan Muller
ANNIEAnnie Hall
HAKANHakan Mild
PIOTRPiotr Volkov
HELENHelen Lindt

Reduction2 sheet:

REDUCTION2Country
ALL*
SWEDENSweden
FINLANDFinland
NORWAYNorway

Thanks to you all who helped me!

Community Browser