Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Flag multiples of an item at location/item

Hi, The Left Join Load below sets a flag in the script (Flag_Possible_Dupe)  when a unique SVMXC_IP_Sibex_Name exists more than once at a SVMXC_IP_Site_Id_Key.    I am struggling to now set another flag where there is more than one SVMXC_IP_Parent_Id_Key per SVMXC_IP_Sibex_Name at a SVMXC_IP_Site_Id_Key.  Any thoughts?  SVMXC_IP:  LOAD SVMXC_IP_Site_Id_Key, SVMXC_IP_Sibex_Name, SVMXC_IP_Parent_Id_Key  FROM \\xxx (qvd)   Left Join Load SVMXC_IP_Site_Id_Key, SVMXC_IP_Sibex_Name, if(count(SVMXC_IP_Sibex_Name)>1,1,0) as Flag_Possible_Dupe Resident SVMXC_IP group by SVMXC_IP_Site_Id_Key, SVMXC_IP_Sibex_Name;

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

LEFT JOIN LOAD

SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name,

if(count(SVMXC_IP_Sibex_NAme)>1,1,0) as Flag_Possible_Dupe,

if(count(distinct SVMXC_IP_Parent_Id_Key)>1,1,0) as Flag_ParentID

Resident SVMXC_IP group by SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name;

I used a distinct count because I assumed you need to check for different parent IDs ... well just guessing.

Again, some sample input data and an exemplary expected result might help us to help you.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

I do not know why my formatting in this forum always chnages after I hit the submit button...

SVMXC_IP:

LOAD

SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name,

SVMXC_IP_Parent_Id_Key,

FROM ...qvd

LEFT JOIN LOAD

SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name'

if(count(SVMXC_IP_Sibex_NAme)>1,1,0) as Flag Possible_Dupe

Resident SVMXC_IP group by SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name;

Works fine to set a flag when a unique SVMXC_IP_Sibex_Name exists more than once at a SVMXC_IP_Site_Id_Key, but I would like to add anothe left join load that flags

when more than one SVMXC_IP_Parent_Id_Key exist per SVMXC_IP_Sibex_Name at SVMXC_IP_Site_Id_Key.

swuehl
MVP
MVP

Maybe

LEFT JOIN LOAD

SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name,

if(count(SVMXC_IP_Sibex_NAme)>1,1,0) as Flag_Possible_Dupe,

if(count(distinct SVMXC_IP_Parent_Id_Key)>1,1,0) as Flag_ParentID

Resident SVMXC_IP group by SVMXC_IP_Site_Id_Key,

SVMXC_IP_Sibex_Name;

I used a distinct count because I assumed you need to check for different parent IDs ... well just guessing.

Again, some sample input data and an exemplary expected result might help us to help you.

Anonymous
Not applicable
Author

Yes, of course you got it swuehl.  Thank you again.  I will be sure to be more specific next time with actaul data and expected results.