Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
annehols
Partner - Contributor
Partner - Contributor

Link color based on dimension value in Sankey chart

I am testing out the Sankey chart custom object from the Qlik Visualization bundle (September 2019 release, update: also tried with November 2019), and I am having some issues with the link coloring. The default look of the chart gives all links in the same color, making the chart a little difficult to read, see image below:

 

Default Sankey chart lookDefault Sankey chart look

 

 

According to this video from Qlik Help , it is possible to give the different dimension values different colors, making the chart much easier to interpret.  At 2:05 in the video, the narrator uses a color code string, "color_hex", in the Link color option under Presentation, and as a result the links are colored according to the source dimension values, see image below:

Multicolored Sankey chartMulticolored Sankey chart

 

This "color_hex"-command does not work for me, it is invalid and only results in all the links disappearing. Using single quotes ('color_hex') results in all the links being colored black. Other common color strings like 'blue()', 'lightgreen()' etc works fine, but again, it gives all the links the same color. 

 

I do understand that a possible solution would be a nested IF-statement along the lines of      IF(CategoryName = 'Sportswear', blue() .....)          for each CategoryName, and then go on to color the links using the  'SOURCE'-command in Link color, but this is not a very good solution, and I would like to avoid it. 

 

Does anyone have a solution for this, am I missing something?  I could not find anything in the documentation relating to this either.   Thanks!

1 Reply
dwforest
Specialist II
Specialist II

My guess is they have a 'color_hex' field or something... not a great video in terms of "how"

I ended up using color(rank([dimension]))  - where the [dimension] is a numeric field.

or color(match([dimension],'value1','value2')) - if the dimension is a limited number of strings.

A third option would be to add a field with the color code to your data