Does anyone know how to filter every other row in a large dataset with 300k+ rows? Assuming we need both odd and even rows in the output, and there is no other condition to filter. I thought of using the Sample tool but that only returns half the answer. And due to the large number of rows, it would be unrealistic to use the Select Records tool either...
Solved! Go to Solution.
Sure thing, @gaoa
Consider the below:
1. add a sort tool for your primary field to make sure you have the order that you need
2. add a record ID tool with field recID and field type Integer 64
3. add a formula tool where column Is_Even is given by: IF Mod([recID]), 2) =0 THEN 1 ELSE 0 ENDIF. However, if your record ID was a text, then use IF Mod(ToNumber([recID]), 2) =0 THEN 1 ELSE 0 ENDIF
4. add a filter tool where Is_Even = 1, and this will split your flow into Even recID out of the true node and Odd recID out of the false node
5. add a union tool at the end of your process if needed to stack the data back into a single table
-Also consider using the Auto Field tool in your flow if you want to make your set as "light" in term of of field size --> processing time --> memory
Please mark it as an acceptable solution if this works for you - Cheers!
You're very welcome @gaoa