Sign In:     


Forum: VirtualDJ Technical Support

Topic: Filter Folder current date/year
Hi everyone,

Is it possible to create a Filter that displays all songs from the current year or today's date, to a chosen year. For example (current year) to 2005 or (today's date) to 1998. The goal is to create a dynamic list of songs from the last 10 years so that in 5 years time that list will still only show songs from the last 10 years.

Thanks in advance
Adam
 

Posted Thu 29 Jun 23 @ 8:38 pm
If going by when the song was added to the database, create a filter folder with the amount of days like below.



 

Thanks. That's one way of doing it. My only concern would be if I updated tags at any point that would reset the song in question.
 

No as the data is stored exclusively in the VDJ database.
 

"First Seen" is the date VirtualDJ added the song on the database.
Typically this should not change by modifying tags.

However this would not be much helpful if you started using VirtualDJ 5 years ago, or if you added a 1996 track on your music collection yesterday.
It would make the song(s) still appear in the last decade filter

For me it would be best to go by fixed dates:

Year >= 2015

This will always return tracks from 2015 until the current date.
You can also make it like this: Year >= 2015 AND Year <=2020
Finally you can try to use one of the automatic ranges VirtualDJ can provide:
group by Year range 10
 

Hello again,

Are scripts usable in filter lists?

Can we use the get_date command to achieve this?

Thanks
Adam
 

Year > "`get_date %Y & param_cast int & param_add -5`"
 

Hey @Locodog, this also works. Brilliant!!! Thank you once again.

I would like to expand on this slightly if possible...

Can we set two points in time (both from the system date) and have the script show tracks from between those 2 points. For example - based on this year (2025)...

1. -10 years = 2015
2. -20 years = 2005
3. displays the years between = 2005 - 2015

I really hope this is possible.

Thanks
Adam
 

Year > "`get_date %Y & param_cast int & param_add -21`" and Year < "`get_date %Y & param_cast int & param_add -9`"
 

@locodog

Thank you...I had a go and managed to work it out from your original script. I used () instead of "". What's the difference between the two methods?

Big respect for the help!

Adam
 

Sent you a couple of beers over ;)
 

thank you very much,

this case no difference, brackets encapsulate and your case encapsulation wasn't needed so really made no difference.
I think strictly speaking " " wasn't need either [I was just working from other older filters I had set up], I think just the ` ` script encapsulation does all that is needed.
brackets are a wide subject that have different uses in different places, in filters they can have 2 uses
1 for more advanced filters that might have several AND/OR conditions, because that becomes difficult without brackets
( artist is bob and key is 11A ) or ( artist is alice and key is 12A )
2 as part of script in filters, again makes longer multi-queries a bit more manageable.
[can't think of a reasonable example but they exist]