Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ravikumar_iyana
Creator
Creator

Removing Duplicates with max() required in straight table

Hi,

I am facing a problem,

In my straight table having two fields

 

teachersubjects
ravi0
anil2
kumar0
ravi1
shiva2
teja2
ravi2
runil              0
ashok              0

In The Table:         1) teacher names are repated

                             2)subjects belongings to count of teacher

My Requirement : 1) I want remove duplicates in teacher with max(subjects) number required

plz help me ASAP.

Thanks

14 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Data:

LOAD teacher,

    subjects

FROM

[https://community.qlik.com/thread/281876]

(html, codepage is 1252, embedded labels, table is @1);

Inner Join(Data)

LOAD

teacher,

max(subjects) as subjects

Resident Data

Group by teacher;

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Ravi,

may be like this:

Data:

Load * Inline [

teacher ,subjects

ravi ,0

anil, 2

kumar ,0

ravi ,1

shiva ,2

teja ,2

ravi ,2

runil ,0

ashok ,0

];

NoConcatenate

DATA1:

LOAD

teacher,

max(subjects) as subjects

Resident Data

Group by teacher;

Drop table Data;

Thanks,

Arvind Patil

ravikumar_iyana
Creator
Creator
Author

Hi Rob Wunderlich,

Thanks for u r suggestion but I'm getting Student and Teacher different Tables plz

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you share a screenshot of your table model?

-Rob

ravikumar_iyana
Creator
Creator
Author

Hi Rob Wunderlich,

in table model:

 

teacher
ravi
anil
kumar
ravi
shiva
teja
ravi
runil
ashok

--------------------------------------

 

subjects
0
2
0
1
2
2
2
0
0

------------------------------------

like this to separate tables

ravikumar_iyana
Creator
Creator
Author

Hi Arvind,

in table model:

teacher
ravi
anil
kumar
ravi
shiva
teja
ravi
runil
ashok

--------------------------------------

subjects
0
2
0
1
2
2
2
0
0

------------------------------------

like this to separate tables



Anil_Babu_Samineni

This script same as Rob, But Join need to be change like

Data:

LOAD teacher,

    subjects

FROM

[https://community.qlik.com/thread/281876]

(html, codepage is 1252, embedded labels, table is @1);

Right Join(Data)

LOAD

teacher,

max(subjects) as subjects

Resident Data

Group by teacher;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What is the link between the teachers and subjects tables?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to do it in the straight table, make your expression max(subjects).