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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
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
jyothish8807
Master II
Master II

Hi Ravi,

You cannot join  both the tables unless you create a primary key. Try to identify a primary key and then you can impliment the logic suggested by Rob.

Best Regards,

KC

Best Regards,
KC
ravikumar_iyana
Creator
Creator
Author

Hi,

I am already using Max(subject) in my straight table expressions then '0' values are unvisible thats the reason i posted in community

Plz give me any valuable suggestions

PrashantSangle

Hi,

Since there is no common field to join both table, and considering both teachers and subjects table at same row in both table then you can use recno() to give row number and using that field you can join both table.

try below script:

Data:

Load RecNo() as rec_no,teacher Inline [

teacherravi

anil

kumar

ravi

shiva

teja

ravi

runil

ashok

];

join

Load RecNo() as rec_no,* Inline [

subjects

0

2

0

1

2

2

2

0

0

];

NoConcatenate

final:

LOAD

teacher,

max(subjects) as subjects

Resident Data

Group by teacher;

Drop table Data;

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
ravikumar_iyana
Creator
Creator
Author

Hi,

I am already  created flag for two tables for unique association purpose

PrashantSangle

what is your flag? can you post your working file.???

Please provide all details to get most appropriate answer, instead of guessing.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂