Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

What is chr(39)? Why it is

This is the code.

Please explain.

LET vTrendStart = '=Date(YearStart(Addmonths(Max(MonthYear), -12)), ' & chr(39) & 'MMMYY' & chr(39) & ')';

LET vTrendEnd = '=Date(MonthStart(Max({<_History = {1}>} MonthYear)), ' & chr(39) & 'MMMYY' & chr(39) & ')';

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

Chr(39) means single quote. If you use single quote directly in the LET statement it will not evaluate properly and that is the reason you use Chr(39). Hope this helps...

View solution in original post

3 Replies
trdandamudi
Master II
Master II

Chr(39) means single quote. If you use single quote directly in the LET statement it will not evaluate properly and that is the reason you use Chr(39). Hope this helps...

arethaking
Creator II
Creator II
Author

Thanks for the answer.could you explain how it will works for the above syntax.

santiago_respane
Specialist
Specialist

Hi,

first of all it is good to know what the CHR function does... It returns the string character corresponding to its number.

Examples:

CHR(13) returns a carriage return

CHR(65) returns A (Capital A)

CHR(64) return @ (At simbol)

CHR(39) returns ' (single quote)

Character codes can be found in multiple sites (Example: http://www.asciitable.com/ )

And the reason why it is being used in that expression is that as you are trying to use single quotes insinde an expression already enclosed by single quotes, so the in the Let statement wont be evaluated properly.

Hope this helps.

Kind regards,