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

Bar chart grouping

Hello,

I'm trying to create a bar chart of closed cases by month. I only want to display 3 months of data. My dimension is "Month Year Closed" my expression is "Count(Cases_Closed)"

How do i limit to last 3 months? and how do group the each months into one bar?

Thanks

MonthYear.png

5 Replies
CarlosAMonroy
Creator III
Creator III

Hi Ann,

So if your MonthYear field has MMM YYYY format, you can try the following:

Expression:

=Count({<[Month Year Closed]={">=$(=MonthName(AddMonths(Max([Month Year Closed]),-2))) <=$(=MonthName(Max([Month Year Closed])))"}>}Cases_Closed)


Now If you want to group the months in one bar:


Go to Object Properties -> Style Tab and then under Subtype section, Select Stacked.


Hope that helps,

Carlos M

vinieme12
Champion III
Champion III

see this post

Dates in Set Analysis

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

subtype is grayed out

CarlosAMonroy
Creator III
Creator III

Oh that's right! It is gray out because you only have one expression! So that option works with 2 or more expressions.

CarlosAMonroy
Creator III
Creator III

If you need to do Stacked bar, update and add the expressions to be:

1st

=Count({<[Month Year Closed]={"=$(=MonthName(AddMonths(Max([Month Year Closed]),-2)))"}>}Cases_Closed)

2nd

=Count({<[Month Year Closed]={"=$(=MonthName(AddMonths(Max([Month Year Closed]),-1)))"}>}Cases_Closed)

3rd

=Count({<[Month Year Closed]={"=$(=MonthName(Max([Month Year Closed])))"}>}Cases_Closed)


Thanks,

Carlos M