Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Julien_OF
Contributor III
Contributor III

Node color expression in Sankey Diagram (Qlik Visualization Bundle)

Hi,

 

Im trying to set node's color automatically instead of setting a fixed color for each dimension value.

I found a trick using this :

Color(round(255*rand( ),1))

But does anyone ever tried to set color by measure value ?

I tried this in Node Color exp :

if( MyMeasure>500,Red(),Green())

But the value displayed differs from the value measured in Node color :

AB = 511, so is > 500, but still green coloredAB = 511, so is > 500, but still green colored

but when I change my Node Color Exp to :

if( MyMeasure=75,Red(),Green())

AB is now Red..AB is now Red..

My goal is to have a gradient Color by measure like we can have in all other elements.

 

Thanks

Labels (2)
1 Reply
rnorris
Partner - Creator
Partner - Creator

Ah, crap. This is all I've found when searching for the same issue, and so it seems like it's just a bug. If I do:

IF(Dimension = 1, color('#hexcodeA'), if(Dimension = 2, color('#hexcodeB')) 

Then I just get all of it coming out as hexcodeA in colour.

If I swap the two palettes over, then it all comes out as hexcodeB. BUT, if I use, say, Red(), then it works and you see two colours. 

It seems to just be a bug with using multiple hex colour values. 

Actually typing this out gives me an idea, maybe I can try converting to RGB and using that? Maybe it's just the actual HEX values that are breaking. Will give it a go.

 

/EDIT: Yeah. Using rgb(x,y,z) instead of color('#hexcode') fixes it.