Can you try removing the word Salarie and start retyping it? Usually QlikView will tell you what the field name is and you can just press enter. This way QlikView will add the name of the field itself and you will be able to see if there are some extra space or something else that was causing the issue for you.
or you can also try adding square brackets around Salarie -> [Salarie] and that might work as well.
Unfortunately sorting value by "Y-Value" does not work because I created a calculated dimension to regroup salaries into intervals.
I want to sort from the smaller interval in terms of salaries ("[-20K€[" ; "[20K€;30K€[" -> "[180K€;240K€[" ; "[+240K€[").
If I sort it by "Y-Value", the "[20K€;30K€[" will come first because most of employees have this salary.
I'll try to share something soon, but I can't share directly my Qlikview, it contains sensitive information.
Your "Salaire" dimension is text and you need to sort it by number. This is similar to sorting months.
One solution is to load the data using the DUAL() function. See help or calendar generators scripts.
Another solution is to add a column in your data that will hold the sorting value. Move your if() expression in the script to calculate a "SalarieSort" column and just write '=SalarieSort' in the sort expression.