Is second reverse needed: sort_by(reverse(sort_by(
reverse(sort_by(@,&update_only))
,&code)),&id). My condition is id=ASC, CODE=DESC and update_only ASC. My instructions will come via json file so it is completely dynamic.