Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have to replace with NULL when there is different 'Point' for different 'number' and different 'Point' for same 'number'. How can I set this in script.
Please can anyone suggest me.
Thanks.
H,
Hi,
Can u share some sample data
Please see attached.
Hi,
Create Flag in script and use that flag in your set analysis.
Regards,
Thanks. can you suggest how to create flag and proceed with set analysis please?
PFA
vikas
Hi
This code will create the flag field (assuming ID is a unique key for the data):
// Get the number values that are associated with more than one distinct Point value
T_Numbers:
LOAD number,
Count(ID) As Rows,
Count(DISTINCT Point) As Count,
Concat(DISTINCT ID, '|') As IDList
Resident Data
Group By number;
// Get the Point values that are associated with more than one distinct number value
T_Points:
LOAD Point,
Count(ID) As Rows,
Count(DISTINCT number) As Count,
Concat(DISTINCT ID, '|') As IDList
Resident Data
Group By Point;
// Get the list of IDs that need to be flagged
T_Flag:
LOAD SubField(IDList, '|') As ID
Resident T_Numbers
WHERE Rows >= 2 And Count >= 2;
// Get the list of IDs that need to be flagged
Concatenate(T_Flag)
LOAD SubField(IDList, '|') As ID
Resident T_Points
WHERE Rows >= 2 And Count >= 2;
// Add the flag field to your data table (1 = flag, null = no flag)
Left Join (Data)
LOAD ID,
1 As Flag
Resident T_Flag;
// Clean up
DROP Table T_Numbers, T_Points, T_Flag;
HTH
Jonathan
Can you please explain your requirement a bit more.
Regards
KC
Thanks. I checked it. I need when there is same point the point should appear in column. when there is different point for same number It should replace with NULL
see please output and I need like this
name | number | point | output |
XX | 0.01 | L1003647 | NULL |
XX | 0.01 | L763753 | NULL |
XX | 11.81 | L1003647 | L1003647 |
XX | 49.64 | L1003647 | L1003647 |
XX | 10.94 | L1003647 | NULL |
XX | 10.94 | L61437 | NULL |
would it be possible?
Thanks.
I have to replace with NULL when there is different 'Point' for different 'number' and different 'Point' for same 'number'. and when it is same point for different number the point should remain as it is. would it be possible
name | number | point | output |
XX | 0.01 | L1003647 | NULL |
XX | 0.01 | L763753 | NULL |
XX | 11.81 | L1003647 | L1003647 |
XX | 49.64 | L1003647 | L1003647 |
XX | 10.94 | L1003647 | NULL |
XX | 10.94 | L61437 | NULL |