I don't know how to remove empty rows from the second table, but I can make only the ones with YES show up.
Making it happen
First, select the first cell of your second table ("carrot", the headers don't matter), and type this in it:
You'll see it transform into a function. Then click the YES/NO column of the same row to add it to the table. Click on the dropdown in the new addition to the formula box, and check "Preserve Column".
This will allow you to copy and paste over the entire row without worrying about the referenced column changing. Add
= "YES" to the end. You should now have something like this:
IF(<Table 1::$B2> = "YES"
Next, add a comma, and click the corresponding cell in your first table:
IF(<Table 1::$B2> = "YES",<Table 1::A2>
Do not preserve the column on this one. You want it to show the corresponding cell in the table. Add
,""), like so:
IF(<Table 1::$B2> = "YES",<Table 1::A2>,"")
Hit the big green checkmark, and copy and paste the cell to fill the second table (or just as many items as you want to show), and you're done!
So what does all this gobbledygook mean?
The IF command has three parts:
IF(condition, if-true, if-false)
If the condition is true, it shows the if-true portion, otherwise it shows the if-false portion. So it shows the value of the other cell if the deciding cell is "YES", or blank ("") if not.