Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stascher
Partner - Creator II
Partner - Creator II

QlikSense Auto sort handling of varchar fields.

Hi All,

I have a QlikSense app that is reading a SQL table which contains a column declared as varchar(19). 

When I display the contents of this column in a QlikSense table visualization with sorting set to Auto the values are sorted by load order.


My question is, since the source column is defined as varchar, shouldn't the Auto setting treat it as text and sort it alphabetically?


If the column were defined as text instead of varchar,  or the SQL in my script cast the field to text, would Auto sorting then sort alphabetically?


Thanks,

Steve

1 Reply
stascher
Partner - Creator II
Partner - Creator II
Author

So it appears that when a varchar is read, Qlik will try to convert the field to something native.. like dual(int), dual(double), int.. etc.  If it isn't sure about the conversion, it leaves the type as unknown, which results in the load-order sorting. It appears that you can use the text() script function  to force text type which will, presumably, have alphabetic sorting by default.