Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 ravikumar_iyana
		
			ravikumar_iyana
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I am facing a problem,
In my straight table having two fields
| teacher | subjects | 
| ravi | 0 | 
| anil | 2 | 
| kumar | 0 | 
| ravi | 1 | 
| shiva | 2 | 
| teja | 2 | 
| ravi | 2 | 
| 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
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 arvind_patil
		
			arvind_patil
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			ravikumar_iyana
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Rob Wunderlich,
Thanks for u r suggestion but I'm getting Student and Teacher different Tables plz
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Can you share a screenshot of your table model?
-Rob
 ravikumar_iyana
		
			ravikumar_iyana
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			ravikumar_iyana
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
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;
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What is the link between the teachers and subjects tables?
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you want to do it in the straight table, make your expression max(subjects).
