Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Strange results from chr() function

I am trying to create a list box which contains an expression to represent a ProjectID plus the Project Name.  An example would be: "PR265-Data Center Virtualization Phase 3"  The expression syntax is:  ='PR'&char(ProjectID)&'-'&Project  This seems to work except that the chr(ProjectID) is displayed as a high-ASCII character, such as a non-english character with accents, not the number I expected.  Data is drawn from a SQL Server 2005 db.  The field ProjectID is of type "int".  I am totally new to QlikView so an help or reference to where I should look would be greatly appreciated.  Thanks!  Terry

1 Solution

Accepted Solutions
phersan_sme
Partner - Contributor III
Partner - Contributor III

if you look at the definition of the function CHR from the help menu, you'll realize this isn't the function you want to use.

chr( n )

The ASCII character corresponding to number n. The result is a string.

Example:

chr( 65 ) returns the string 'A'.

You can try using "text" or don't even use a function at all

='PR'&text(ProjectID)&'-'&Project

or

='PR'&ProjectID&'-'&Project

View solution in original post

3 Replies
phersan_sme
Partner - Contributor III
Partner - Contributor III

if you look at the definition of the function CHR from the help menu, you'll realize this isn't the function you want to use.

chr( n )

The ASCII character corresponding to number n. The result is a string.

Example:

chr( 65 ) returns the string 'A'.

You can try using "text" or don't even use a function at all

='PR'&text(ProjectID)&'-'&Project

or

='PR'&ProjectID&'-'&Project

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

chr() is the wrong function for this case. You want to use text().

='PR' & text(ProjectID) &'-'&Project

-Rob

http://robwunderlich.com

Not applicable
Author


Thanks Phersan and  Rob for the excellent and very prompt help.  I begin to see why I have heard others rave about how good the community support is for this product!