Create a multiline demand forecasting graph

I would like to create a graph like this graph:

I have 2 datasets:

  1. Historical data for each product how many sold till a specific date
  2. Forecast data for each product I have 2 columns: lower or upper level

I want to join these tables by product id and create this graph the problem I’m encountering is that I that the x line can be only the dates of one of the tables (or the historical data dates or forecast dates)

I need to create a graph that starts from the first date in the historical data till the end date of the forecasted data.

Thank you in advance,

Can you left join on date as well and make one date for both tables?

Then you would have a “type” regular, upper, and lower.

Then you would have the unified date as the x-axis and the “type” as the color

1 Like

Hi Max,
Thank you for your quick replay, I have tried that and the dates range is not as expected:

The graph looks like this:

This is the forecasted table data - as you can see the last date is 31/12/2017 and in the graph is till 9/12/23:

Would appreciate your help :slight_smile:

Ah, try not to join on date.

And in SQL or quicksight run a case statement.

case when date is null then timestamp else date end

1 Like

Hi @PlanToIt,
We hope the reply from @Max worked for you.
Let us know if this is resolved. And if it is, please help the community by marking the reply as a “Solution.”
Many Thanks,

1 Like