finish pivotquery