Bom baq based on view as assembly in method

I need to create a indented bom but only based upon the view as assembly criteria being set. So if view as is checked I want to explode out to the nth level else if view as is not checked then don’t explode out. The canned bom listing report does this but I need it in a baq so I can quickly pull multiple parts. How can this be done?

I looked at the bom listing report in report builder but nothing worthwhile came of my observations. Hopefully someone knows how to recreate this report in a baq.

This thread has a exploding bom query. I don’t know how to factor in the view as assembly in the CTE.

in theory, the view as assembly could be used to filter out the items that do/dont need exploded in the recursive bom that @gpayne referenced… just one more criteria to put into the query.