Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Valued Contributor III

Bar chart

Hi All,

I have a bar chart that has to display two years on the X-axis

"Current selected Year" and "Current selected year minus 1"

On the Y axis there is a count like say count of Policies.

Suppose the user selects 2005 then the count of policies to be displayed is from jan 2005 until today.

Two years have to be displayed here 2005 and 2005 minus 1 i.e. 2004

However since the dimesntion I add is the Year insead of two years there will be multiple bars displayed correcponding to all teh years from 2004/2005 until today with the count contribution for each year.

Could anyone please suggest how i would be able to achieve something like that?


Rajesh Vaswani

1 Reply

Re: Bar chart

If your years are numbers, maybe this?

count({<Year={">$(=max(Year)-2)"}>} Policy)

If dates formatted as YYYY, maybe this?

count({<Year={">$(=date(addmonths(max(Year),-24),'YYYY'))"}>} Policy)