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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
A_PR
Contributor III
Contributor III

Custom Filter - Date Range

1000232556.jpg

 Hello All,

Please help me create a graph like this in Qliksense. I want the user to select the month in the filter. Eg. If Nov 2025 is selected.. it should show data from year start to month selected. Jan- Oct 2025. And a partition like line and the month selected from previous year and current year.

 

Thanks

PA

Labels (2)
1 Reply
BIAKS
Contributor
Contributor

BIAKS_0-1767083704891.png

You can do something like this by using dimension reference line and set analysis.
If you have a master calendar you can add these dimensions:

Date(monthstart(TempDate),'MMM-YYYY') as MonthYear,
Date(monthstart(AddYears(TempDate,-1)),'MMM-YYYY') as LastMonthYear,
Date(YearStart(TempDate),'MMM-YYYY') as YearStartMonth,

for the expression you can do something like this:

Sum({<MonthYear={">=$(=YearStartMonth)<=$(=GetFieldSelections(MonthYear))"}>+<MonthYear={"$(=LastMonthYear)"}>} Expression1)

you can see that we added the previous year's same month with: 

+<MonthYear={"$(=LastMonthYear)"}

for the sorting, use sort by expression on MonthYear and write this:

Match(Only({1} MonthYear),'$(=MonthYear)', '$(=LastMonthYear)', MonthYear)

for the coloring, I used this:

If(Max({1} CalendarDate)>YearStart(Today()),Blue(),Green())

and finally for the dimension reference line, you can use the following:

=MonthStart(Max({<MonthYear={"<=$(=GetFieldSelections(MonthYear))"}>} CalendarDate))

If you cant see anything, try selecting a "MonthYear" first.

Hope this works for you.