Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
narasimhakotta
Contributor

how to reduce the duplicate records in section access

Hi Devps,

         how can i reduce duplicate of rows in following group table when i asign more then one city to users(manager or excutive) , in my original db i have 10 to 20 citys for a single user,so do i need to duplicate 20 rows or is there any method to handle in a single row

like

match(city,'HYD','BNG')

i have attached the sample file and db modal please check once.

Section Access;

LOAD * INLINE [

    ACCESS, UserID, ORDER,ROLEORDER

    ADMIN,ADMIN,1,1

    USER,MANAGER,2,2

    USER,EXCUTIVE,3,3

    USER,SUPERVISOR,4,4

];

Section Application;

STAR is *;

Group:

Load * Inline [

ORDER,CARCITY,BIKECITY

1,*,*

2,"HYD","HYD"

2,"BNG","BNG"

3,"HYD","HYD"

];

Cars:

LOAD * Inline [

Carname,CARCITY,CARPERSON

Honda,HYD,NARSIMHA

HERO,HYD,NARSIMHA

Maruti,BNG,PRASAD

Maruti,KOlKOTTA,PRASAD

];

Bikes:

LOAD * Inline [

BikeName,BIKECITY,BIKEPERSON

Honda,BNG,NARSIMHA

Tvs,HYD,PRASAD

Tvs,KOlKOTTA,PRASAD

];

demodb.png

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: how to reduce the duplicate records in section access

like below

Group:

Load * Inline [

ORDER

1

2

3

];

left join(Group)

Carcity:

Load ORDER,

Subfield(CARCITY,',') as CARCITY

Inline [

ORDER,CARCITY

1,"*","*"

2,"HYD,BNG"

3,"HYD,BNG,MUM"

];

6 Replies
vinieme12
Esteemed Contributor II

Re: how to reduce the duplicate records in section access

use left join !  from User to City that is it

narasimhakotta
Contributor

Re: how to reduce the duplicate records in section access

user means the group table u mean ? can you please write query once

Re: how to reduce the duplicate records in section access

If you already have those Cities listed per User in your DB, then why don't you just make a copy of this database table and call it Group?

vinieme12
Esteemed Contributor II

Re: how to reduce the duplicate records in section access

like below

Group:

Load * Inline [

ORDER

1

2

3

];

left join(Group)

Carcity:

Load ORDER,

Subfield(CARCITY,',') as CARCITY

Inline [

ORDER,CARCITY

1,"*","*"

2,"HYD,BNG"

3,"HYD,BNG,MUM"

];

narasimhakotta
Contributor

Re: how to reduce the duplicate records in section access

hi peter,

     i can call it from database but i need to reduce the number of rows for a single user in the above group table i marked the rows duplicating when user having more then one city so how to reduce from 2 rows to one row

narasimhakotta
Contributor

Re: how to reduce the duplicate records in section access

Thank you vineeth its worked