select: extract code for drilldown