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: 
Not applicable

show a time period in chart based on max date

Hi All,

I would like a chart to show the six months ending in the max associated date.  I have tried the following:

            =SUM({$<CLOSEMONTH_SORT = {">= $(vRolling6MonthMin)"}>}RO_FLAG)

where vRolling6MonthMin is defined as the max date minus six months.  This works correctly if a range of more than six months is selected.  For example, if I select January thru November, it shows me June thru November.  But if I select only November, it shows me only November.  How can I make it ignore the date selection, but still determine the range based on the highest selected date?

Thanks for your help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add modifiers for the fields you want to be ignored:

=SUM({$<MyMonthField=, CLOSEMONTH_SORT = {">= $(vRolling6MonthMin)"}>}RO_FLAG


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add modifiers for the fields you want to be ignored:

=SUM({$<MyMonthField=, CLOSEMONTH_SORT = {">= $(vRolling6MonthMin)"}>}RO_FLAG


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks, Gysbert.  That works, but because I am ignoring those fields, I have to define both a beginning and end date--so the expression becomes

     =SUM({<CLOSEMONTH_SORT = {">= $(vRolling6MonthMin)"} * {"<= $(vCurrentMonth)"}, YEAR=, QUARTER=, MONTH= >}RO_FLAG)