Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

color/shape of points basedon expression

I saw discussion where expression like this

if(Gender='M',RGB(255,0,0),RGB(200,200,200))

were suggested to put into Chart properties->Expressions.

It doesn't work for my scatter plot. Putting the expression into the first variable (X-axis) backgound color changes color in legends, but not data points(see inserted image). Somehow related question, how to change shape of data points based on a expression

error loading image

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Oleg,

Thanks for your suggestions. The "Multicolored" checkbox is unchecked.. I have copied the expression from the post at this forum

=if(Gender='M',RGB(255,0,0),RGB(200,200,200))

I do have empty values in the "gender" column. but why it would scew up the expression? In my undersanding empty valus are epty string? Anyway how can i error log in case the expression is wrong?

Thanks

Vlad

View solution in original post

8 Replies
Not applicable
Author

Hi,

see the attached example.

It works for QV version 8.50.6261 and 9.

Rainer

Anonymous
Not applicable
Author

The chart is not displayed on my computer. "No data to display" message is in the chart area. Black lines are above.

I use free demo/personal edition QlikView for Windows, v.9.00.7119.4 . I got some warning messages when i opened your file first. I could debug it because it can't be opened again."file contains inconsistences and canot be opened by personal edition".

Looking at your chart properties it seems has the coloring expression in "backgroung color" for the first dimension. As told before it doesn't work in my plot. I attached the screenshot of my seetings . I would greatly appreciate code snippets or instruction instead of qkw file. I couldn't open any example files from the forum or wiki. QlikView always compalin about some version inconsistence

Thanks

Vlad

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Vlad,

welcome to QlikView 🙂

Check your settings in the "Colors" tab, make sure that "Multicolored" checkbox is unchecked. Another reason for a color expression to be ignored is if it returns a null() or another "unexpected" value - check your syntax and make sure it returns a valid color.

Regarding shape - as far as I know, Scatter charts only support bubbles (either 3D or 2D), but no other shapes. You can control the size of the bubble by using the third expression.

cheers,

Oleg

Anonymous
Not applicable
Author

Oleg,

Thanks for your suggestions. The "Multicolored" checkbox is unchecked.. I have copied the expression from the post at this forum

=if(Gender='M',RGB(255,0,0),RGB(200,200,200))

I do have empty values in the "gender" column. but why it would scew up the expression? In my undersanding empty valus are epty string? Anyway how can i error log in case the expression is wrong?

Thanks

Vlad

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Try creating a simple Straight Table with Gender as one of the dimensions, and use your expression as a Color expression for the text color or a backgound. See if it works there.

Can you post your application here? I'd try to check it out.

Oleg

Not applicable
Author

Hi,

I had the same problem with my scatter charts as well, I wanted them to be just single coloured or dual coloured. The solution I wound was that the background colour settings on the first expression only work if you have only one(1) dimension. See attached pictures of my settings. As soon I had two(2) dimensions it was the same like yours.

Matthias



Anonymous
Not applicable
Author

Matthias,

you got it right . I had a second dimension in my chart that apparently has priority under Expressions.

Thanks

Vlad

Anonymous
Not applicable
Author

Oleg,

Scatter plots can have data points of different shapes based on a second dimension. My question if I don't have second dimension, can i control sapes (circle,triangle etc) explicitly . probably via Expression->text format?

Thanks

Vlad