Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year Comparison

Hi There,

I am trying to do this, I have an bar graph with total count of something, distributed by year.

So, I Want to, when I click in 2015 another graph shows me the total count of the 2014 year, when a click in 2016 this graphs shows me the 2015 year, so goes on...

Does anyone knows how to do this?

Thanks in advice,

Rodrigo Peixoto.

13 Replies
Gysbert_Wassenaar

If you select only one year then you can adapt the expression in the target chart to show the count of the previous year. Suppose that chart now has an expression like count(Orders) you can change that to count({<Year={$(=max(Year)-1)}>}Orders). This assumes that your year field has the name Year. Make sure to use the correct case sensitive field names of your document.


talk is cheap, supply exceeds demand
jjordaan
Partner - Specialist
Partner - Specialist

Try this

SUM({$<Year={$(=Max(Year)-1)}>} SalesAmount)

sunny_talwar

You should be able to use The As-Of Table conecpt here : The As-Of Table

Not applicable
Author

All of this formulas gave me the 0 result.

I am thinking that te as-of table concept will be the only way to do this.

sunny_talwar

The other options will work, but we won't know the exact scenario of what you are doing, would you be able to share a sample to look at and propose a working expression?

Not applicable
Author

I've started a new app and make this formulas and worked, but in my first app it can't be done.

In my original app, I've made a join with a kml, can this be the cause of the problem?

Not applicable
Author

I've found my problem.

I was using the formula =year(date)  to get the year, but I also have the fiel "Year" in my table. Using the field Year, I could get the information, but by year(date) no. There is a way to do with the formula "=year(date)"?

sunny_talwar

Where were you using Year(Date) in the expression?

Not applicable
Author

I have one drill-down graph, where I use the formula =year(date) and =month(date) to make the field.

So, in this drill-down graph, if I choose one year, the other graph with this formula (SUM({$<Year={$(=Max(Year)-1)}>} SalesAmount) , nothings happens, but, if I make one bar graph use the field year (instead of getting the year by the formula =year(date)) its works fine.

Anyway to solve this problem?