Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

How can I show Actual vs Forecast in a single Line Chart line where if there YTD Flag is not 1, use forecast values instead for the line?

Hi all,

I have a table that looks like this:

Month
YTD Flag
Actual
Forecast
Jan1100200
Feb1100200
Mar1100200
Apr1100200
May1100200
Jun1100200
Jul1100200
Aug1100200
Sep1100200
Oct-100300
Nov-100300
Dec-100300

What I would like to do is create a Line Chart where it shows using one line what the actual spend is and when there is no YTD flag, use Forecast value instead for the remaining months.

So in the aboe, up to Sep it would a line consisting of values up to 100, and then the line rises to 300 for Oct, Nov, and Dec because YTD flag has nothing.

Does anyone know how to do this please? Example of an expression?

3 Replies
Anil_Babu_Samineni

You can create line chart and then use full accumulation croon expression tab

Then don't suppress the null values. You might achieve

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jblomqvist
Specialist
Specialist
Author

Hi Anil,

I cannot use this. I am looking to do it the expression way.

Anil_Babu_Samineni

Ok, Like this

Capture.PNG

Dim is Month

Expression is If([YTD Flag] = 1, Sum(Actual), If([YTD Flag] = Null(), Sum(Forecast),Sum(Forecast)))


PFA

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful