change data frame df to qs during calculation