PHOENIX-1344 fix duplicit values in NTH_VALUE function

description at pull request to master #24