Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
Could you, please, help me with scripting the following. I want to exclude events (whole rows in the table) fitting two conditions:
1) value is equal to N,
2) number of "values equal to N" is counted more than 10.
For example, there is a field 'status' with values a) single, b) married and I want to keep only 10 single ones and to delete the others.
As far as I understood, I need to use WHERE function within LOAD. But I have no idea in which way it shoukd be scripted.
Could you, please, help me with that?
Thank you!
Hi Marina,
Try like this:
Load top 10 *
from New.qvd (qvd)
where status = 'single';
Here I restricted to top 10 rows. If you vae any ID field then you can modify where statement like this:
where status = 'single' and ID<=10;
I hope this helps.
Regards,
RK
MyTable:
FIRST 10
LOAD * FROM ...source... WHERE Value = 'N';
Concatenate(MyTable)
LOAD * FROM ...source... WHERE Value <> 'N';
Many thanks, Rakesh and Gysbert!
May I write it this way:
... WHERE 'Field' ='value' <>'N' ?
Or this is incorrect?
To follow your example of singles: WHERE status = 'single'. Make sure to use the exact case-sensitive field names and values.
Thank you so much, Gysbert!
If you consider the question answered, please flag the correct answer and close the topic.
If not, please make clear what other information you are still looking for.