Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Kaushik2020
Creator III
Creator III

How to Last month values on the Current month Graph

Hello Everyone,

I am using a combo chart where I am showing Count for rolling 12 Months as Bar. 

I wanted to show dots/line in a combo chart where these dots represent values from the previous Year. Is it possible ?  

 

kaushi2020_0-1706615882117.png

Dimension - MonthYear

Measure: Sum({<Year, Month,Date={"$(='>=' & Date(MonthStart(addmonths(Max(Date), -12))) & '<' & Date(Max(Date)))"}>}
Count)

 

4 Replies
anat
Master
Master

use Month field as a dim instead of monthYear

then you can use 2 measures to show current and previous year data

Kaushik2020
Creator III
Creator III
Author

thanks for your reply. but reading the data will be difficult as the user will have to assume based on the calendar date. is there any other ways we can plot the points ?

kaushi2020_0-1706688295837.png

Expectation is to  plot data for the previous MonthYear on the bar as a line. 

Chanty4u
MVP
MVP

Try this

Dimension: MonthYear

 

Measure for Bar (Rolling 12 Months):

Sum({<Year, Month, Date={"$(='>=' & Date(MonthStart(addmonths(Max(Date), -12))) & '<' & Date(Max(Date)))"}>} Count)

 

Measure for Dots/Lines (Previous Year):

Sum({<Year={$(=Year(Max(Date))-1)}, Month>}

Count)

Kaushik2020
Creator III
Creator III
Author

thanks for your reply, Expectation should be we should get values of Jan-22 on the Jan-23 Bar chart. 

here when we use the shared expression - it will show the same as Jan-23 instead of Jan-22 for the bar. Please suggest.

kaushi2020_0-1706767236776.png