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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue with missing months in Canonical Calendar

I am using Canonical Calendar in my script and need to show only last 12 months . The graph shows missing months when plotted as is but i need to display the graph for only last 12 months. When I try to show last 12 months then the months where there is a blank value is not shown in the graph and is skipped.

I have used the below in the Dimensions.

=if(Month<MonthStart(today()) and Month>monthname(AddMonths(today(),-14)),Month)

Can anybody please help as to what is going wrong in my chart?

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Use set analysis filters in the chart expressions rather than a calculated dimension. I also add a month sequence number to my calendars which makes this type of analysis much simpler:

Define the field something like this in your calendar load:

   (Year(tmpDate) - 2000) * 12 + Month(tmpDate) as MonthSequence,

Then use this in your expressions with Month as a dimension:

Sum({<MonthSequence = {">=$(=Max(MonthSequence) - 12)"}>} Value)

Turn off suppress zero values to see the 0 value months.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein