Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prathu
Partner - Contributor
Partner - Contributor

Grouping the rating based on duplicate IDs

Hi , can you please help group the ratings and amount which are linked to duplicate IDs

ID

Ratings

Amount

1

2A

200

1

2B

300

2

3A

400

2

4B

300

3

5A

500

4

6A

800

4

7B

200

5

8A

400

6

9A

100

 

Desired Output

Ratings

Amount

2A

200

2B

300

3A

400

4B

300

6A

800

7B

200

 

1 Solution

Accepted Solutions
Saravanan_Desingh

One solution is.

tab1:
LOAD * INLINE [
    ID, Ratings, Amount
    1, 2A, 200
    1, 2B, 300
    2, 3A, 400
    2, 4B, 300
    3, 5A, 500
    4, 6A, 800
    4, 7B, 200
    5, 8A, 400
    6, 9A, 100
];

Right Join(tab1)
LOAD *
Where Cnt > 1;
LOAD ID, Count(ID) As Cnt
Resident tab1
Group By ID;

Drop Field Cnt;

View solution in original post

2 Replies
Saravanan_Desingh

One solution is.

tab1:
LOAD * INLINE [
    ID, Ratings, Amount
    1, 2A, 200
    1, 2B, 300
    2, 3A, 400
    2, 4B, 300
    3, 5A, 500
    4, 6A, 800
    4, 7B, 200
    5, 8A, 400
    6, 9A, 100
];

Right Join(tab1)
LOAD *
Where Cnt > 1;
LOAD ID, Count(ID) As Cnt
Resident tab1
Group By ID;

Drop Field Cnt;
Saravanan_Desingh

Output.

commQV63.PNG