Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Conditional Performance Indicators in Tables using HTML Unicode Chr() Values

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
richbyard
Contributor III
Contributor III

Conditional Performance Indicators in Tables using HTML Unicode Chr() Values

Last Update:

Jun 18, 2017 8:29:35 AM

Updated By:

richbyard

Created date:

Jun 18, 2017 8:29:35 AM

Attachments

Inserting KPI indicators into tables is actually quite simple if you understand the HTML Unicode UTF-8 characters that are available for you to use and display with simple if conditions. These characters behave like any other text so applying conditional colors is very simple.

Some examples, an example application and a link to many character options are at the bottom of this post.

Setting up the Measure

The measure needs to be a simple if statement, for example:

if([Sales This Year]>[Sales Last Year],chr(9650),chr(9660))

Where 9650 and 9660 are the triangle up and down character codes based on standard HTML Unicode UTF-8 charsets.

Setting up the conditional colours

Under Text color Expression use an if statement to switch the colours similar to the measure expression, for example:

if([Sales This Year]>[Sales Last Year],rgb(0,220,0),rgb(255,0,0))

pic5.jpg


Note:

I have used the field names of the columns in the table to create these expressions rather than repeat the measure expression by wrapping the field label in square brackets (as you will most likely know as of version 3.2 we can not reference the Master Items here). For this method to work both fields must be visible in the table.

Straight table example

pic7.jpg

pic2.jpg

Pivot table example

pic6.jpg

Pic1.jpg

Example Characters and codes can be found here, there are many different groupings with this link taking you to the Geometric shapes.

Some useful Characters and codes are below:

Character CodeCharacter DescCharacter
9604LOWER HALF BLOCK
9605LOWER FIVE EIGHTHS BLOCK
9606LOWER THREE QUARTERS BLOCK
9607LOWER SEVEN EIGHTHS BLOCK
9608FULL BLOCK
9609LEFT SEVEN EIGHTHS BLOCK
9610LEFT THREE QUARTERS BLOCK
9611LEFT FIVE EIGHTHS BLOCK
9612LEFT HALF BLOCK
9613LEFT THREE EIGHTHS BLOCK
9632BLACK SQUARE
9650BLACK UP-POINTING TRIANGLE
9658BLACK RIGHT-POINTING POINTER
9660BLACK DOWN-POINTING TRIANGLE
9668BLACK LEFT-POINTING POINTER
9679BLACK CIRCLE
9680CIRCLE WITH LEFT HALF BLACK
9681CIRCLE WITH RIGHT HALF BLACK
9682CIRCLE WITH LOWER HALF BLACK
9683CIRCLE WITH UPPER HALF BLACK
9684CIRCLE WITH UPPER RIGHT QUADRANT BLACK
9685CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
9698BLACK LOWER RIGHT TRIANGLE
9699BLACK LOWER LEFT TRIANGLE
9700BLACK UPPER LEFT TRIANGLE
9701BLACK UPPER RIGHT TRIANGLE
9733BLACK STAR
9734WHITE STAR
9745BALLOT BOX WITH CHECK
9746BALLOT BOX WITH X
9754BLACK LEFT POINTING INDEX
9755BLACK RIGHT POINTING INDEX
9785WHITE FROWNING FACE
9786WHITE SMILING FACE
9787BLACK SMILING FACE
9829BLACK HEART SUIT
9830BLACK DIAMOND SUIT
9872WHITE FLAG
9873BLACK FLAG
9898MEDIUM WHITE CIRCLE
9899MEDIUM BLACK CIRCLE
9940NO ENTRY
9978TENT
9989WHITE HEAVY CHECK MARK
9995RAISED HAND
10003CHECK MARK
10004HEAVY CHECK MARK
10005MULTIPLICATION X
10006HEAVY MULTIPLICATION X
10007BALLOT X
10008HEAVY BALLOT X
10009OUTLINED GREEK CROSS
10010HEAVY GREEK CROSS
10011OPEN CENTRE CROSS
10026CIRCLED WHITE STAR
10060CROSS MARK
10062NEGATIVE SQUARED CROSS MARK
10067BLACK QUESTION MARK ORNAMENT
10068WHITE QUESTION MARK ORNAMENT
10069WHITE EXCLAMATION MARK ORNAMENT
10070BLACK DIAMOND MINUS WHITE X
10071HEAVY EXCLAMATION MARK SYMBOL
Comments
Anonymous
Not applicable

Wow, great list.  Talk about an awesome post to bookmark!

Lots of great eye-openers in this list.  For instance, I didn't realize that there were the little quarter-block, half-block, & three quarters-block characters (in fact, looks like they even have them by eigths, etc.)  ...All good for some creative approaches for unicode & the chr() function.

Bonus:  Some of these can be used with the repeat(x, ) function as well to create extending status-bars or error-bars, and probably a variety of others too.

beck_bakytbek
Master
Master

Thank a lot for your sharing

richbyard
Contributor III
Contributor III

I haven't played with the repeat (x,y) function before but it's a great suggestion as you can now assign a weighting to how good/bad something is in your expression (double arrows when it meets a condition as dramatically changing)..

pic2.JPG

FYI - I played with the example app and changed the expression to... (meaningless but interesting to test)

=repeat(if([Sales This Year]>[Sales Last Year],chr(9650),chr(9660)),

if(fabs([Sales This Year]-[Sales Last Year])>[Sales This Year],2,1))

Thanks for the suggestion tedemang

luismadriz
Specialist
Specialist

Very handy!. Many thanks. Cheers. Luis

0 Likes
muktasrivastava
Contributor
Contributor

Hi,

Is there a way to make this field selectable ?

0 Likes
beck_bakytbek
Master
Master

Hi Mukta,

you can make the field as selectable only in QlikView with the help of function: Inputfield, but this function is not available in Qlik Sense. In Qlik Sense you solve this issue by using of extensions.

i hope that helps

Beck

muktasrivastava
Contributor
Contributor

Thanks Beck for the information.

Do you know any particular extension for Qlik Sense which i can use?

0 Likes
beck_bakytbek
Master
Master

Hi Mukta,

look at this: Qlik Branch

i hope, you find the solutions for your issue / business case

0 Likes
Taps
Contributor II
Contributor II

Hi Friends!

How will I apply color to the symbols in the Total row. It is showing as black.

I have tried "Dimentionality", but it did not worked. Also, it will not help to change the color basis on condition. It will fixed the header with a single color.

If (dimentionality=0, LightGreen() - Here, no other condition can set for multiple conditon.

 

Thanks

Taps

0 Likes
Version history
Last update:
‎2017-06-18 08:29 AM
Updated by: