# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save \$400. Learn More
New Contributor

## Colour scatter points relative to reference lines

Can any one show me how to colour the scatter points on this chart based on the following rules

1. If points are in top right quadrant then colour Green

2. If points are in bottom right then colour Red

3. If points are in bottom left then colour Orange

4. If points are in top left then colour blue

Bare in mind the reference points are set relative to the percentile so will move as and when new data is added.

12 Replies
Contributor

## Re: Colour scatter points relative to reference lines

Why a new post?

What's the difference with https://community.qlik.com/thread/301500   ?

New Contributor

## Re: Colour scatter points relative to reference lines

If you look the source data is formatted differently meaning my expressions are different. I'm not sure how to rearrange the colour definition

Contributor

## Re: Colour scatter points relative to reference lines

ok

OkOk
Let's work step by step.
First . in  the expressions, you need to use set analysis
"Sales",
SUM({<Year = {"=\$(=Year(Today()))"}>}Sales)
"Variance"
SUM({<Year = {"=\$(=Year(Today()))"}>}Sales)-SUM({<Year = {"=\$(=Year(Today())-1)"}>}Sales)
New Contributor

## Re: Colour scatter points relative to reference lines

Thanks for the help. Now my chart looks like this?

Contributor

## Re: Colour scatter points relative to reference lines

Here's a first step implementation ...
I added a YearType column in the script, with values PY (Present Year) and LY (Last Year), null otherwise
Please note that Today is calculated at Refresh Time ... you should probably use the Now function
Please note that with the given data you only have two "quadrants"
Contributor

## Re: Colour scatter points relative to reference lines

Good,

You can now apply formulas similar to the one we saw before

New Contributor

## Re: Colour scatter points relative to reference lines

Sorry I'm confused the points on the chart are not displayed as they were before.

For instance there are no negative variances

Contributor

## Re: Colour scatter points relative to reference lines

When I opened the original app, there were no data

New Contributor

## Re: Colour scatter points relative to reference lines

Sorry this has become too complicated for my skill level. I wanted a solution similar to the first post without having to use set analysis.

Don't worry, thanks for your help though