Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zakpullen
Creator
Creator

Load rows only if ID number is repeated more than once

Hi,

I need to load data only where Assignment Number exists more than once. From the data below, only the rows for assignment number 89273314 should be loaded in the script, because it appears twice. I've tried Where and Count, but can't figure it out.

tbl.JPG

Many thanks

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

May be using a Right Join

Table:
LOAD * INLINE [
    Assignment Number, Organization Name
    89273319, Dept A
    89273314, Dept B
    89273314, Dept A
    89273308, Dept B
];

Right Join (Table)
LOAD [Assignment Number]
Where Count > 1;
LOAD [Assignment Number],
	 Count([Assignment Number]) as Count
Resident Table
Group By [Assignment Number];

View solution in original post

2 Replies
sunny_talwar

May be using a Right Join

Table:
LOAD * INLINE [
    Assignment Number, Organization Name
    89273319, Dept A
    89273314, Dept B
    89273314, Dept A
    89273308, Dept B
];

Right Join (Table)
LOAD [Assignment Number]
Where Count > 1;
LOAD [Assignment Number],
	 Count([Assignment Number]) as Count
Resident Table
Group By [Assignment Number];
zakpullen
Creator
Creator
Author

That works! Thank you so much.