Hi @jtroxel,
It looks like the only reason you need calculated fields to convert Age and Grade to strings is because you need to display that “Unknown” value in your pivot table. Do you have columns in your data source that contain the age and grade as numbers? If so, you should include them in your dataset so that you don’t need to create yet another calculated field to convert the strings back to numbers.
You need one calculated field to display in your table and another to use for sorting. Something like this:
Display Field = ifelse(${RowParameter} = ‘Age’, {Age_String}, ${RowParameter} = ‘Grade’, {Grade_String}, null)
Sort Field = ifelse(${RowParameter} = ‘Age’, {Age_Number}, ${RowParameter} = ‘Grade’, {Grade_Number}, null)
Select the “sort by off-visual field” option and sort by “Sort Field”.
If you can upload some sample data to Arena and share it here, I can take a look and see why the sorting is not working correctly. I haven’t encountered this issue before.