Você está na página 1de 4

chr( n ) function

Chr(AsciiNumber) will return the character of given ASCII number. Generally this is used when we
want to insert single quote(') in our expression or in concatenation, since it is an error to mention
single quote between ''.

Example:
If we want form a string like this - don't we need to use like below

='don' & Chr(39) & 't'

Or if you want to display Qlikview & Qliksense in two different lines in text object

='Qlikview' & Chr(10) & 'Qliksense' -- Ascii code for Carriage return is 10 --- Chr(10) = Enter key

output is:
Qlikview
Qliksense

Everyone knows that sometimes we need to use chr() function to put paragraph sign - chr(13) or
single-quote -chr(39).
But sometimes you need a special symbol, but you dont know the number. You can find it in the
Internet, but Ive found a Qlik way how to do it.

Just create a straight table.

Add Calculated Dimension =ValueLoop(1,100) or even =ValueLoop(1,10000)

Add Expression chr(RowNo())

And find a symbol that you need.

There is a faster way, If you found a symbol in the Internet and would like to know what is the number
for this char.
For example delta sign

Use the ord() function


Ord() gives you 916. So if you need to put this symbol somewhere you can use chr(916)

Some interesting codes are


=chr(9650) & chr(9651) & chr(9660) & chr(9661)

=chr(9733) and =chr(9734)

Be aware!
in the comments in different discussion Jaime Aguilar mentioned that
"using chr() function you can display any ASCII / ANSI character (from chr 0 to 255) or Unicode chars
(from chr 256 and up). The corresponding number in chr() function for the Unicode chars is the
number referred as decimal, that can be found in plenty internet sites. Almost any Unicode char will
display in ajax, but in some cases the correct displaying will depend on the page encoding."

How to Create Bullet Charts / Graphs


There are a number of steps involved. First you have to create a gauge chart.
orientation : horizontal
Do the gauge settings now:
Max: Usually 120% of your expression. e.g. Sum(Revenue) *1.2
Indicator, Model
Show Needle
Style
Line
Switch of autowidth segments
Hide Segment boundaries, Gauge Outlines
Create 3 segments or more
Segment1 lower bound => 0.0
2 lower => 0.5
3 => 0.9
give relevant colors
Finish

Now add a new Bar chart


no dimension, but add your expression sum(Revenue)
Orientation : Horizontal
Forced 0
Hide Axis both switched on

static max again 120% of your measure


goto color, set transparency to 100%
Layout tab: set shadow to No shadow
border width to 0
layer should be Top
caption turned off
finish
Emboss bar chart over Gauge chart.

I tweaked with the Combo-Chart settings for a little while but I knew I would get it. Here it
is, no extension, straight forward, you can use variables to set the parameters and add
color segments where needed:

Since it is a standard object there are all possible settings you can make with font sizes,
line width, show axis etc.
Enjoy

Você também pode gostar