Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
stascher
Partner - Creator III
Partner - Creator III

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 III
Partner - Creator III
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.