Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
simone_g
Contributor II
Contributor II

Line chart: hide future months

Hello,

I can't visualize data through a line chart correctly.

This is what I need to do:

  1. Show all 12 months for each product
  2. Hide the line for future months ( may 23, june 2023, etc.)
  3. If in the past there were no sales for a specific month, set the line to zero

Please see the attachment.

Thank you in advance!

Labels (1)
2 Solutions

Accepted Solutions
MayilVahanan

Hi

Instead of 2 measure, Try like below

Dim: Month, Year
Exp: Sum(Sales )+ sum( {1} 0 )

It will help you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

MayilVahanan

Hi

Try like below

Sum( {<year={">=$(=year(today())-1)"}, Date={"<$(=MonthStart(Today()))"}>} Sales ) + sum( {1<year={">=$(=year(today())-1)"}, Date={"<$(=MonthStart(Today()))"}>} 0 )

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

Hi

Instead of 2 measure, Try like below

Dim: Month, Year
Exp: Sum(Sales )+ sum( {1} 0 )

It will help you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
simone_g
Contributor II
Contributor II
Author

Thank you! It was helpful! 🙂

Now suppose that I have sales data from 2021 to 2013. Is it possibile to show just the last two years in the line chart (i.e. 2022 and 2023)?

Can I hide sales data of the current month ? For example, sales data of 2023-05-01 ? I would like to hide them because the full data for the current month are not available yet.

Please see the attachment.

Thank you !

 

 

MayilVahanan

Hi

Try like below

Sum( {<year={">=$(=year(today())-1)"}, Date={"<$(=MonthStart(Today()))"}>} Sales ) + sum( {1<year={">=$(=year(today())-1)"}, Date={"<$(=MonthStart(Today()))"}>} 0 )

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.