Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need a flag to show records where count is more than 1.
I am trying this in the script "if(count(fieldname > 1, 1,0) as flag" or in the listbox but it's not working. I would prefer it to be outside the script.
So by clicking 1 the user gets to see the duplicates and by clicking 0 unique records.
Please advise
Thanks
You can probably combine this into one like this:
Data:
ID, // ID is key field
Field
FROM table;
New:
LOAD ID,
If(Count(Field) > 1, 1, 0) as Flag
resident Data
group by ID;
DROP Table Data;
Data:
ID, // ID is key field
Field
FROM table;
new:
LOAD *,
if(Cnt>1,1,0) as Flag;
LOAD ID,
Count(Field) as Cnt
resident Data
group by ID;
You can probably combine this into one like this:
Data:
ID, // ID is key field
Field
FROM table;
New:
LOAD ID,
If(Count(Field) > 1, 1, 0) as Flag
resident Data
group by ID;
DROP Table Data;
Thanks Sunny, it works
Do you really want to Flag in backend.
Else you can do following:-
LOAD * INLINE [
Flag
1
0
];
I don't think it will make much difference. Do you think different?
For a small set of data, no. But for a big data set with a lot of ids, preceding load can be bad. Remember our yesterday's discussion where Marcus was talking about how preceding load can slow down.
@sunnysahni is this solution not working?
Yeah correct.