Forum

This content is now out of date.

Visit Our Community

Filter between year and year – 1

Hi!!!

We have a filter year, this is a number type.
Exists the possibility that when a user choose one year the system automatically also filter by one year minus.

For example if the user choose year 2012, the report will be filtered by 2012 and 2011.

The user only needs to enter the first year.

Thanks
Hi,

yes this is possible, just add two instances of the year filter to the report:


Forum image


then link one to the other and change the operator to Greater Than, and then apply the subtraction:


Forum image


I hope that's what you were after, please let us know how it goes.

Regards,
Dave

yes, this has solved my problem!!!
Another question, related with this subject.

If the customer have a year field that is a integer, how can I do the same?
It seems that your solution only works if the field is date type and then I adapt in the view step (formatting to only year).

Thanks
Hi Jordi,

That is correct.
When a field is a 'date' you have a calender picker and also able to minus/add date periods.
If the field is integer, it's simply a number. This is true for any database.

You can however convert integers to dates via database functions. Each database does it slightly different.

Just find the right date formula and then use this in a virtual table , or calculated fields in Yellowfin. Your field will then be a date and you will have the options you were after.

Regards,
David