Create p_pivot_query_total