Author Topic: Virtual tag with month only  (Read 1228 times)

vamarci

  • Newbie
  • *
  • Posts: 7
Hi there,
I sometimes like to sort my library by the date added field. So far so good. However, I would like to use to "group by" function, with only the month of the date added field (or, alternatively, group by yyyy/mm, which is pretty much the same...).
I understand that I can use virtual tags for this purpose but I'm quite new to these and haven't managed to create the right function command for this.
Could anyone help me out? Probably quite easy if you know what you're doing...

hiccup

  • Hero Member
  • *****
  • Posts: 8050
That is rather easy:

$Split(<Date Added>,"-",2)

You could also do something more complicated like this:

Code
$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Pad($Split(<Date Added>,"-",2),2),01,January),02,February),03,March),04,April),05,May),06,June),07,July),08,August),09,September),10,October),11,November),12,December)
It makes it more pleasantly readable, but the drawback is that sorting will be alphabetical and not chronological.
 
searching the forum:    method 1   ·   method 2   ·   method 3                            latest MusicBee patches:   here                            all virtual tag functions:   here

vamarci

  • Newbie
  • *
  • Posts: 7
Thank you! I tried the simpler code but when I try to group by the tag, it doesn't group in any way, just makes an "unknown" heading at the top. of the cover view...

This is how I set up the virtual tag which then I tried to use for the grouping:


Did I do something wrong?

hiccup

  • Hero Member
  • *****
  • Posts: 8050
Do your 'added dates' look like this?
(the same formatting?)

searching the forum:    method 1   ·   method 2   ·   method 3                            latest MusicBee patches:   here                            all virtual tag functions:   here

vamarci

  • Newbie
  • *
  • Posts: 7
Ah, ok, so instead of the dash I have slash symbol.


So I replaced the dash in the formula you wrote above. It works, thanks!
- I do the main grouping by "Date added (album)" as usual
- Then I sub-group by Virtual1 tag.

Would it also be possible to do the main grouping using the the virtual tag? And then perhaps have it be sth like yyyy/mm (or mm/yyyy) instead of just mm.
Thanks a bunch!

Also, sth funny happens which is independent of the virtual tag which I haven't noticed before: if I do the main grouping by date added, and it generates the automatic groups of "last 7 days", "last month", etc., then when I arrive at the "last year", there are quite a few albums which actually belong to this year but still get grouped under last year main heading. See for instance here:


the album Nimbus was added Feb 5, however, it gets grouped under last year. Nevertheless, it still receives the 02 [February] for the sub-grouping... Strange!


edit: apparently, albums added this year appear fine, but once last year starts the sub-grouping doesn't work that well. See e.g. here


This happens multiple times...
Last Edit: May 09, 2020, 01:21:16 PM by vamarci


phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9472
up! anyone?
Please show a little patience before bumping your thread. Especially something was posted a little more than twenty-four hours ago. Everyone posting here is a user. Some just starting to use MB and others who have been around for years. We all try to help each other WHEN and IF we can. There is no one monitoring the forum 24/7. Sometimes questions don't get answered because no one has seen your post yet. Sometimes no one has the answer. If you don't see a reply after three or four days, then you should bump it. But not with only twenty-four hours passed.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

vamarci

  • Newbie
  • *
  • Posts: 7
up! anyone?
Please show a little patience before bumping your thread. Especially something was posted a little more than twenty-four hours ago. Everyone posting here is a user. Some just starting to use MB and others who have been around for years. We all try to help each other WHEN and IF we can. There is no one monitoring the forum 24/7. Sometimes questions don't get answered because no one has seen your post yet. Sometimes no one has the answer. If you don't see a reply after three or four days, then you should bump it. But not with only twenty-four hours passed.

Gotcha. Although I have to say the post was getting buried, and it wasn't "only twenty-four hours" (since we're counting, it was 53 hours to be precise...)