Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ax
Contributor II
Contributor II

Line chart show the latest value instead of zero

Hi,

I have a line chart where the dimension is Year Month and the measure is Price.

For future months the price is 0 but instead of it, I would like the line chart to show the last positive value for the future months.

For some reason, FirstSortedValue or Sum does not work with measure Price.

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Ax
Contributor II
Contributor II
Author

I could not use the pre-calculated master item in the expression. When I copied the formula for the master item instead of using it, it worked.

View solution in original post

3 Replies
Taoufiq_Zarra

@Ax  can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Ax
Contributor II
Contributor II
Author

Currently the line chart is showing

Year Month Price
Jan 2022 100
Feb 2022 120
Mar 2022 0
Apr 2022 0

 

What I would need is to copy the last price to the future months

Year Month Price
Jan 2022 100
Feb 2022 120
Mar 2022 120
Apr 2022 120

 

I don't know why but the Sum or FirstSortedValue do not recognize the 'Price' so I can't use those functions. 

However, when I use it inside if function it recognizes it. For example IF(Price > 0, Price) works. I would just need somehow add to the else statement the most recent value that is not 0.

Ax
Contributor II
Contributor II
Author

I could not use the pre-calculated master item in the expression. When I copied the formula for the master item instead of using it, it worked.