Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Champion III
Champion III

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"

];

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

6 Replies
vinieme12
Champion III
Champion III

use left join !  from User to City that is it

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

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

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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
Champion III
Champion III

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"

];

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Thank you vineeth its worked