14 Replies Latest reply on May 8, 2018 3:40 PM by Elie Rahi

# Segment Line into 2 Colours

I need to segment a line in a line plot into two different colours. One colour showing Jan-Apr 2018 actual and another colour showing the forecast May-Dec 2018. I'm unsure how to go about doing this. I tried doing a calculated field:

IF [Month 1] >= #1/05/2018# THEN "Forecast"

ELSE "Actual"

END

But has not worked out

• ###### 1. Re: Segment Line into 2 Colours

Hello Elie,

Can you post the sample data to help you better?

S

• ###### 2. Re: Segment Line into 2 Colours

Hello, please see attached

• ###### 3. Re: Segment Line into 2 Colours

Also, I haven't been able to put in a forecast and instead applied a formula in the Excel spreadsheet in the data source. This isn't ideal and would prefer to have the forecast done within the viz

• ###### 4. Re: Segment Line into 2 Colours

Hi Elie,

What you are looking for is a trend line projector if i rightly understand,check the below,it shows in two diff colours.

you can download workbook and look at the approach.

hope it helps.

BR,

bharat

• ###### 5. Re: Segment Line into 2 Colours

Hi,

Try duplicating the measure and use below calculation.

measure 1:

IF [Month 1] >= #1/05/2018 then measure 1 else null

measure 2:

IF [Month 1] < #1/05/2018 then measure 2 else null

then present both measure in the same chart.

Regards,

pavan

• ###### 6. Re: Segment Line into 2 Colours

Hello, I'm not having much luck. Can you please use the attached spreadsheet and make this happen

• ###### 7. Re: Segment Line into 2 Colours

Hello Elie,

Please let me know if this helps

S

• ###### 8. Re: Segment Line into 2 Colours

Hi Elie,

Is this what you are looking for ?

There's much more elegant methods, but I just used a set to indicate in/out and put this on colour

HTH 2018.1 attached

Peter

1 of 1 people found this helpful
• ###### 9. Re: Segment Line into 2 Colours

This is what I originally had. What I need is dates after May 2018 to be in a different colour to show its a forecast. So I need 3 colours in total for the viz, a yellow colour for 2017, purple colour for Jan-Apr 2018 and a grey colour for May-Dec 2018

• ###### 10. Re: Segment Line into 2 Colours

Just saying...

1 of 1 people found this helpful
• ###### 11. Re: Segment Line into 2 Colours

Thanks Peter. I don't actually know much about sets but this was helpful.

The only thing outstanding is that I need the X-axis to show the month Jan, Feb...Dec and not Month/Year

• ###### 12. Re: Segment Line into 2 Colours

Peter, I would need something like:

The yellow refers to 2017, Purple is Jan-Apr 2018 and Grey is May-Dec 2018

• ###### 13. Re: Segment Line into 2 Colours

Hi Elie,

Did u get a chance to check the links i shared earlier?

They do meet your requirement.

BR,

bharat

• ###### 14. Re: Segment Line into 2 Colours

Hi Kumar, I have seen the links and is not what I'm after