I'm using data merge to generate pages from a product spreadsheet. The complication is, some columns should exist for some products (like "qty per bundle") but need to be hidden for others. Is there a way for InDesign to automatically include or remove rows for some pages but not others, based on something like "qty = 0"?
It sounds like something that might be scripted. I'm not a scripter. If someone doesn't provide an answer here, try the InDesign Scripting forum.
For logic-based data merge, I use Em Software's product InData.
Depending upon the design, ID's merge can remove blank fields thereby removing there paragraph or position on a line. Unless, of course, you have static text along with it. Which I almost always do. that's why I use Em Software's solution. It has a trial version. One needs to get familiar with the language statements. But for me it was worth the price and learning curve.
And there are other plug-ins but for "simple" merging they are overkill in my circumstances (and so cost more).