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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

restrict display on barchart

Hi,

I need to display a barchart with a dimension year and month.

i have to show only the months that's present in all the year.

For example: if i have january and february in 2011 and only january in 2012, i've to show only january.

thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can try a set analysis expression. Suppose you now have sum(Sales) as expression. You can change that to sum({<Month={'<=$(=max({<Year={$(=max(Year))}>}Month))'}>}Sales). If you select 2012 and 2011 in the field Year and 2012 only has data for january then 2011 will also show only data for january. BTW, the Month field needs to be numeric of <= won't work (creating a month from a date with Month(MyDate) will create a usably month field).


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can try a set analysis expression. Suppose you now have sum(Sales) as expression. You can change that to sum({<Month={'<=$(=max({<Year={$(=max(Year))}>}Month))'}>}Sales). If you select 2012 and 2011 in the field Year and 2012 only has data for january then 2011 will also show only data for january. BTW, the Month field needs to be numeric of <= won't work (creating a month from a date with Month(MyDate) will create a usably month field).


talk is cheap, supply exceeds demand
Not applicable
Author

it was exctly what i needed

thanks